You need to sign in to do that
Don't have an account?

Excute method is not covering in test class for batch class
global void execute(Database.BatchableContext BC, List<sObject> scope){
List<lead> leads = (List<lead>)scope;
for(lead ld : leads){
if(ld.Status == 'Open' ){
ld.test__c=True;
testlist.add(ldj);
}
Only this lines of code is not covering in test class ,please suggest me how to solve this.
List<lead> leads = (List<lead>)scope;
for(lead ld : leads){
if(ld.Status == 'Open' ){
ld.test__c=True;
testlist.add(ldj);
}
Only this lines of code is not covering in test class ,please suggest me how to solve this.
1) http://amitsalesforce.blogspot.com/2016/02/batch-apex-in-salesforce-test-class-for.html
Please post your full batch job and test class
NOTE:- You need to create your test data according to you Batch job start method