I'm having created a pretty simple test Utility Class. the utility class should create two records: an account and a related child (Legal entity). Legal entity is a master detail relationship to the account.
This is the utility class I have created.
public class LegalEntityV1{
public static Account createOneAccount(){
Account testAccount = createAcct('ABC Computing inc.');
Legal_Entity__c testLegalEntity = createLE(testAccount);
return testAccount;
}
// Helper methods //
//
public static Account createAcct(string accountName) {
Account a = new Account(
Name=accountName);
insert a;
return a;
}
public static Legal_Entity__c createLE(Account a){
Legal_Entity__c c = new Legal_Entity__c(
Legal_Entity_Code__c = '1',
Name = 'name',
Organisation__c = a.ID); // *** Error is here ***
insert c;
return c;
}
}
I have another class which calls the method above. However I am getting the following error:
Compile Error: Method does not exist or incorrect signature: createAcct(String) at line 17 column 28
@isTest
public class bg_AMLProcessExtension_Test {
//DM Attempt //
// Test data setup create 1 account with one Legal entity by calling utility method
public static void TestDeleteAccountWithOneOpportunity() {
Account testAccount = createAcct('Test');
insert testAccount;
LegalEntity testEntity = createLE('Test LE', testAccount.ID);
insert testEntity;
AML_Process__c aml = new AML_Process__c(
//Client__c = testAccount1.Id,
Legal_Entity__c = testEntity.Id,
Client_Director__c = UserInfo.getUserId(),
Client_Executive__c = UserInfo.getUserId(),
Legal_Entity_Name__c = 'SIM UK',
Stage__c = 'Checks In Progress',
Screening_1_Complete__c = Label.AML_Screening_1_Not_Complete,
Screening_2_Complete__c = Label.AML_Screening_2_Not_Complete
);
insert aml;