Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @isTest
- public class ActiveContactFactoryTest {
- public static List<Contact> getContact(String accountName, Integer numberOfCont, Integer activeCont){
- Account testAccount = new Account(Name = accountName);
- insert testAccount;
- List<Contact> contactList = new List<Contact>();
- for(Integer i = 0; i < numberOfCont; i++){
- Boolean isActive = i < activeCont;
- contactList.add(new Contact(LastName = 'Contact' + i + ' for ' + accountName, AccountId = testAccount.Id, Is_Active__c = isActive));
- }
- return contactList;
- }
- }
Add Comment
Please, Sign In to add comment