function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajkumar CV 12Rajkumar CV 12 

Please help me in writing Test class for the below code

List<Case> localemailaddress = new List<Case>([SELECT ID,AV_Local_Affiliate_Inbox__c FROM Case Where Id IN : newCaseMap.keySet()]);
if(localemailaddress.size()>0 && localemailaddress!=null&&localemailaddress.get(0).AV_Local_Affiliate_Inbox__c!=null){
String affiliateemail=String.valueOf(localemailaddress.get(0).AV_Local_Affiliate_Inbox__c);

Please let me know it is very urgent.
Rajkumar CV 12Rajkumar CV 12
The affiliateemail is always passing null value while test class is getting executed.
Leo10Leo10
Hi Rajkumar,

Are you sure that you have value in the newCaseMap.keySet()?

Regards,
Leo
Rajkumar CV 12Rajkumar CV 12
Yes , I had a debug statement written. It passes the value every time. Thanks.