You need to sign in to do that
Don't have an account?
Harshitha B
Testclass for Sending an email before x days and update the opportunity stage
Hi All,
I am unable to proceed with the Test class for one of my batch class implemented recenlty.
Batch class Implementation: batch will process the opportunity records, based on the values which is stored in custom metadata types. I am sending an email before x days of closure and update the stage based on the value which is in the custom metadata types.
Logic implemented for sending email before x days:
I am not able to cover this lines in the test class, below are the things I implemented in test class.
the above result value is CloseDate > today()
Scenerio 2:
the above result value is CloseDate < today()
please suggest how to proceed further.
Thanks.
I am unable to proceed with the Test class for one of my batch class implemented recenlty.
Batch class Implementation: batch will process the opportunity records, based on the values which is stored in custom metadata types. I am sending an email before x days of closure and update the stage based on the value which is in the custom metadata types.
Logic implemented for sending email before x days:
Date sendEmailDate= opportunityVar.CloseDate .addDays( Integer.ValueOf(mdtVar.STS_Expected_Awarded__c - mdtVar.STS_Notify_Before__c)) IF(System.today() == sendEmailDate){ // logic to send an email }
I am not able to cover this lines in the test class, below are the things I implemented in test class.
Integer days = Integer.valueOf(mdtVar[0].expectedAwardDate - mdtVar[0].notifyBefore); oppVar.Closedate = system.today() +days;
the above result value is CloseDate > today()
Scenerio 2:
Integer days = Integer.valueOf(mdtVar[0].expectedAwardDate + mdtVar[0].notifyBefore); oppVar.Closedate = system.today() -days;
the above result value is CloseDate < today()
please suggest how to proceed further.
Thanks.