Test Class – Insert Account and Contact

@isTest
public class TestAcctContact {
static testMethod void testInsertAcctContact() {

Account a   = new Account();
a.Name      =’Tes123′;
insert a;

Contact c   = new Contact();
c.FirstName = ‘TestFirstName’;
c.LastName  = ‘TestLastName’;
c.AccountId   = a.Id;

insert c;
}
}

Print Friendly, PDF & Email
This entry was posted in Main. Bookmark the permalink.