You need to sign in to do that
Don't have an account?
samita das 7
Unable to cover the below lines in my test class, however i have already inserted the objects
for (Account_Partners__c pr: listPartner) {
if (pr.Partner__c == parentId) {
pr.Partner__c.addError(System.Label.Account_Partner_Error);
return pageRef;
} else if (pr.Partner__c != null) {
pr.Account_Name__c = parentId;
}
partners_list.add(pr);
if (pr.Partner__c == parentId) {
pr.Partner__c.addError(System.Label.Account_Partner_Error);
return pageRef;
} else if (pr.Partner__c != null) {
pr.Account_Name__c = parentId;
}
partners_list.add(pr);
first method will cover the IF condition
and second method will core the else part.
If you want detail pls provide us test class code i will help you