You need to sign in to do that
Don't have an account?
Shannu
how to write test class for following accounts on map code
public class LightningMapCntrl {
Public String accountIds{get;set;}
public LightningMapCntrl(ApexPages.StandardSetController cntlr){
List<Account>selAccounts = cntlr.getSelected(); //get selected records from account list view
accountIds = '';
for(Account acc : selAccounts){
accountIds += acc.Id + '-'; //build list of ids string concatenated with comma
}
accountIds = accountIds.removeEnd('-');
system.debug('+++ IDs : ' + accountIds) ;
}
@auraEnabled
public static List<Account> getAccountList(String accountIds){
system.Debug('++++ accountIds : ' + accountIds);
List<String> accountIdList = accountIds.split('-');
return [Select Id, Name, type , BillingCity, BillingStreet,BillingPostalCode,BillingCountry, BillingState from account where Id In: accountIdList ];
}
}
Public String accountIds{get;set;}
public LightningMapCntrl(ApexPages.StandardSetController cntlr){
List<Account>selAccounts = cntlr.getSelected(); //get selected records from account list view
accountIds = '';
for(Account acc : selAccounts){
accountIds += acc.Id + '-'; //build list of ids string concatenated with comma
}
accountIds = accountIds.removeEnd('-');
system.debug('+++ IDs : ' + accountIds) ;
}
@auraEnabled
public static List<Account> getAccountList(String accountIds){
system.Debug('++++ accountIds : ' + accountIds);
List<String> accountIdList = accountIds.split('-');
return [Select Id, Name, type , BillingCity, BillingStreet,BillingPostalCode,BillingCountry, BillingState from account where Id In: accountIdList ];
}
}
You can use the below code to get started
If this information helps, please mark the answer as best. Thank you
All Answers
You can use the below code to get started
If this information helps, please mark the answer as best. Thank you
Hi Sai,
You can use the below code to cover the coverage of the given class:
If this helps, Please mark it as the best answer.
Thanks