Fix failing unit-test
This commit is contained in:
@@ -124,14 +124,15 @@ private class fflib_SObjects2Test
|
||||
@IsTest
|
||||
static void itShouldReturnStringById()
|
||||
{
|
||||
final String accountName = 'My Account';
|
||||
final Id accountId = fflib_IDGenerator.generate(Schema.Account.SObjectType);
|
||||
final Account record = new Account(Id = accountId, Name = 'Test');
|
||||
final Account record = new Account(Id = accountId, Name = accountName);
|
||||
fflib_SObjects2 domain = new fflib_SObjects2(new List<Account>{ record });
|
||||
System.Test.startTest();
|
||||
Map<String, Id> nameById = domain.getIdFieldByStringField(Schema.Account.Id, Schema.Account.Name);
|
||||
System.Test.stopTest();
|
||||
System.assert(nameById.containsKey('Test'));
|
||||
System.assertEquals(accountId, nameById.get(accountId));
|
||||
System.assert(nameById.containsKey(accountName));
|
||||
System.assertEquals(accountId, nameById.get(accountName));
|
||||
}
|
||||
|
||||
@IsTest
|
||||
@@ -591,4 +592,4 @@ private class fflib_SObjects2Test
|
||||
clearField(Schema.Account.ShippingCountry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user