• Tiffany Leszcynski
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I am getting an error in the dev console that my variables (i and n) do not exist. I've compared to other posts and can't seem to find where my error is. Run tests = 0% What am I missing here?
@isTest
private class AddPrimaryContactTest {
    @testSetup static void TestingList() {
        List<Account> acc = new List<Account>();
        for (Integer i=0;i<50;i++); {
            acc.add(new Account(BillingState = 'CA', name = 'Testing ' + i));
        }
        for (Integer n=0;n<50;n++); {
            acc.add(new Account(BillingState = 'NY', name = 'Testing ' + n));
        }
    insert acc;
        Contact con = new Contact();
        con.FirstName = 'First Name';
        con.LastName = 'Last Name';
        insert con;
        String state = 'CA';
    AddPrimaryContact apc = new AddPrimaryContact(con, state);
    test.startTest();
    	system.enqueueJob(apc);
    test.stopTest();
    }
}