I've been working on a test method but I've had a problem creating the setup of it.
public static List<Job_Posting__c> createPostings(){
List<Job_Posting__c> testPostings = new List<Job_Posting__c>();
List<Position__c> testPositions = new List<Position__c>();
List<Employment_Website__c> testEmploymentWebsites = new List<Employment_Website__c>();
for(Integer i=0; i<10; i){
testPositions.add(new Position__c(Name = 'Test '+ i, Status__c = 'Closed - Filled'));
insert testPositions;
testEmploymentWebsites.add(new Employment_Website__c(Name = 'Test' +i));
insert testEmploymentWebsites;
testPostings.add(testPostions, testEmploymentWebsites);
}
return testPostings;
I know my insertion of into testPostings is wrong but how would I insert both into it. I know both Position and EmploymentWebsites will share a name. So would I insert that way?