Hi,
Here goes further explanation.
List<Partner_Level_Criterias__c> MyPLCLst = [select Sales_Certification_Name__c,Technical_Certification_Name__c,Sales_Certification_Count__c,Technical_Certification_Count__c from PartnerLevel__c ];
for (PartnerLevel__c p : MyPLCLst )
{
SalesCertName = String.valueOf(p.Sales_Certification_Name__c);
TechCertName = String.valueOf(p.Technical_Certification_Name__c);
if (AccreditationName==SalesCertName)
{
SalesCertCount = Integer.valueOf(p.Sales_Certification_Count__c);
SalesAccreditationName = AccreditationName;
} // end if (AccreditationName==SalesCertName)
if (AccreditationName==TechCertName)
{
TechCertCount = Integer.valueOf(p.Technical_Certification_Count__c);
TechAccreditationName = AccreditationName;
} // end if (AccreditationName==TechCertName)
} // end of for MyPLCLst
if (SalesCertName!=NULL && TechCertName!=NULL && SalesAccreditationName!=NULL && TechAccreditationName!=NULL)
{
/**************** TILL THIS IT GETS CODE COVERAGE***************************/
/***************** THE LINES AFTER THIS SHOWS UP IN RED COLOR **************/
if (SalesAccreditationName==SalesCertName)
{
if (TechAccreditationName==TechCertName)
{
if (SalesAccredCertCount==SalesCertCount)
{
if (TechAccredCertCount==TechCertCount)
{
TEST CLASS CODE SNIPPET :
Here is the code snippet from test class where I call PartnerLevel__c
PartnerLevel__c pl=new PartnerLevel__c(Sales_Certification_ID__c=AccountAccr.ID,Sales_Certification_Count__c=5);
insert pl;
PartnerLevel__c pl1=new PartnerLevel__c(Technical_Certification_ID__c=AccountAccr1.ID,Technical_Certification_Count__c=3);
insert pl1;
Call to Batch Apex class.
How should I cover the following which is checked after the for (PartnerLevel__c p : MyPLCLst ) loop ends.
if (SalesAccreditationName==SalesCertName)
{
if (TechAccreditationName==TechCertName)
{
if (SalesAccredCertCount==SalesCertCount)
{
if (TechAccredCertCount==TechCertCount)
{