User Story
As a Salesforce administrator, I want to automate the creation of 100 new accounts with distinct names, so that I can efficiently populate the system with test data for evaluation and testing purposes.
Codes
public class AccountCreator {
public static void create100Accounts() {
List<Account> accountList = new List<Account>();
for (Integer i = 1; i <= 100; i++) {
Account newAccount = new Account();
newAccount.Name = 'New Account ' + i;
accountList.add(newAccount);
}
insert accountList;
}
}
Test Class
@isTest
public class AccountCreatorTest {
@isTest
static void testCreate100Accounts() {
Test.startTest();
AccountCreator.create100Accounts();
Test.stopTest();
}
}
Video
Video does not exists.