Guest User

Untitled

a guest
Jan 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. @isTest
  2. public class ActiveContactFactoryTest {
  3. public static List<Contact> getContact(String accountName, Integer numberOfCont, Integer activeCont){
  4. Account testAccount = new Account(Name = accountName);
  5. insert testAccount;
  6. List<Contact> contactList = new List<Contact>();
  7. for(Integer i = 0; i < numberOfCont; i++){
  8. Boolean isActive = i < activeCont;
  9. contactList.add(new Contact(LastName = 'Contact' + i + ' for ' + accountName, AccountId = testAccount.Id, Is_Active__c = isActive));
  10. }
  11. return contactList;
  12. }
  13. }
Add Comment
Please, Sign In to add comment