+ Start a Discussion

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()) {
  //Add the AccountId to the Ids List
  for(LogAccountTasks__c LogAcc : lstLogAccountTasks) {
   //Prepare oldMap
   //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;
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);

This is really urgent.
Rahul KumarRahul Kumar (Salesforce Developers) 
Hi ,
Do You got a chance to check the Test generator app from App Exchange please check the below link

Hope it will be helpful.

Please mark it as best answer if the information is informative.

Rahul Kumar