Add getDecimalById to fflib_SObjects2

Signed-off-by: WimVelzeboer <william@velzeboer.nl>
This commit is contained in:
WimVelzeboer
2023-04-13 11:10:45 +01:00
parent d32d33ba28
commit 3d9e8fae8a
2 changed files with 31 additions and 0 deletions
@@ -165,6 +165,16 @@ private class fflib_SObjects2Test
System.Assert.isNull(result.get(caseIdC), 'Case Id B should have no related Account Id');
}
@IsTest
static void itShouldReturnDecimalById() {
final Id accountId = fflib_IDGenerator.generate(Schema.Account.SObjectType);
final Account record = new Account(Id = accountId, AnnualRevenue = 123.45);
fflib_SObjects2 domain = new fflib_SObjects2(new List<Account>{ record });
System.Test.startTest();
Map<Id, Decimal> result = domain.getDecimalById(Schema.Account.AnnualRevenue, Schema.Account.Id);
System.Test.stopTest();
}
@IsTest
static void itShouldReturnStringById()
{