You need to sign in to do that
Don't have an account?
virk
Writing Test method
Hello Salesforce Expertise
Can someone please help me in writing test method for this code?
List<Id> accIds = new List<Id>();
List<LogAccountTasks__c> lstTasks; //= new <List>logAccountTasks();
List<Id> lstAccIds;
//List<Account> TrigNew;
Map<id, Account> TrigoldMap;
List<Account> lstmemoryAcc;
Account tmpAcc;
if (lstLogAccountTasks == null || !lstLogAccountTasks.isEmpty()) {
return;
}
//Add the AccountId to the Ids List
for(LogAccountTasks__c LogAcc : lstLogAccountTasks) {
//Prepare oldMap
lstAccIds.add(LogAcc.AccountId__c);
//Prepare List for simulate Trignew
tmpAcc = null;
tmpAcc.Id = LogAcc.AccountId__c;
tmpAcc.Etat_relation_GEO__c = LogAcc.Etat_futur_de_la_relation_geo__c;
tmpAcc.RecordTypeId = LogAcc.AccRecordTypeId__c;
tmpAcc.R_seau_int_gr__c = logAcc.Type_de_reseau__c;
lstmemoryAcc.add(tmpAcc);
}
for (Account acc : [select Id, Etat_relation_GEO__c from Account WHERE Id=:lstAccIds]) {
TrigoldMap.put(acc.Id, acc);
}
UpdateStatus.hierarchyAccountDeploiment(lstmemoryAcc, TrigoldMap);
UpdateStatus.hierarchyAccountTerminer(lstmemoryAcc, TrigoldMap);
UpdateStatus.terminerFilByAccount(lstmemoryAcc);
This is really urgent.
Can someone please help me in writing test method for this code?
List<Id> accIds = new List<Id>();
List<LogAccountTasks__c> lstTasks; //= new <List>logAccountTasks();
List<Id> lstAccIds;
//List<Account> TrigNew;
Map<id, Account> TrigoldMap;
List<Account> lstmemoryAcc;
Account tmpAcc;
if (lstLogAccountTasks == null || !lstLogAccountTasks.isEmpty()) {
return;
}
//Add the AccountId to the Ids List
for(LogAccountTasks__c LogAcc : lstLogAccountTasks) {
//Prepare oldMap
lstAccIds.add(LogAcc.AccountId__c);
//Prepare List for simulate Trignew
tmpAcc = null;
tmpAcc.Id = LogAcc.AccountId__c;
tmpAcc.Etat_relation_GEO__c = LogAcc.Etat_futur_de_la_relation_geo__c;
tmpAcc.RecordTypeId = LogAcc.AccRecordTypeId__c;
tmpAcc.R_seau_int_gr__c = logAcc.Type_de_reseau__c;
lstmemoryAcc.add(tmpAcc);
}
for (Account acc : [select Id, Etat_relation_GEO__c from Account WHERE Id=:lstAccIds]) {
TrigoldMap.put(acc.Id, acc);
}
UpdateStatus.hierarchyAccountDeploiment(lstmemoryAcc, TrigoldMap);
UpdateStatus.hierarchyAccountTerminer(lstmemoryAcc, TrigoldMap);
UpdateStatus.terminerFilByAccount(lstmemoryAcc);
This is really urgent.
Do You got a chance to check the Test generator app from App Exchange please check the below link
https://appexchange.salesforce.com/listingDetail?listingId=a0N3A00000EFozgUAD
Hope it will be helpful.
Please mark it as best answer if the information is informative.
Thanks
Rahul Kumar