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

Test class coverage help?
public class ContactpQueueable implements Queueable {
public List<Contact> conToInsert = new List<Contact>();
public List<Contact> conToDeleteList = new List<Contact>();
public void execute(QueueableContext context) {
if(!conToInsert.isEmpty()){
Database.insert(conToInsert );
}
if(!conDeleteList.isEmpty()){
Database.delete(conToDeleteList);
}
}
}
public List<Contact> conToInsert = new List<Contact>();
public List<Contact> conToDeleteList = new List<Contact>();
public void execute(QueueableContext context) {
if(!conToInsert.isEmpty()){
Database.insert(conToInsert );
}
if(!conDeleteList.isEmpty()){
Database.delete(conToDeleteList);
}
}
}
Please update the test class as follow
It will give you 100% code coverage.
Thanks
All Answers
Hi Navya,
You can try below code for the test class
I covered only 71% percent.
Database.insert(conToInsert );
Database.delete(conToDeleteList);
two line not covered.
Thanks
Navya
Please update the test class as follow
It will give you 100% code coverage.
Thanks
Try the below code it works for me and cover the 100% code: I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi