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
Suraj DemgundeSuraj Demgunde 

Can anyone help me for writing test class for below code?

global class ICC_ReminderEmails implements Database.Batchable<sObject>{
    
    
     global list<ICCWorkbench__c> start(Database.BatchableContext BC){
        return [select id,name,Vendor_Name__c ,Organization_ID__c,Vendor_Name__r.name,Vendor_Name__r.Email__c,Vendor_Name__r.Email1__c,Vendor_Name__r.Email2__c,Vendor_Name__r.Group_Email__c,MppsubmittDate__c,CreatedDate,(select id,Sales_Order__c from Workbench_Sources__r) from ICCWorkbench__c where Supplier_Status__c ='Submitted To Supplier' AND MppsubmittDate__c=Last_n_days:1];
   }

     global void execute(Database.BatchableContext BC, List<ICCWorkbench__c> scope){
        system.debug('Scope -->' + scope);
        List < Messaging.SingleEmailMessage > emails = new List < Messaging.SingleEmailMessage > ();
           
        for(ICCWorkbench__c wcb : scope){
                
                               List<String> emailAddress  = wcb.Vendor_Name__r.Group_Email__c.split(';'); 
                               System.debug(emailAddress);
                               if(wcb.Vendor_Name__r.Email__c != null)
                                emailAddress.add(wcb.Vendor_Name__r.Email__c);
                               if(wcb.Vendor_Name__r.Email1__c != null)
                                emailAddress.add(wcb.Vendor_Name__r.Email1__c);
                               if(wcb.Vendor_Name__r.Email2__c != null)
                                emailAddress.add(wcb.Vendor_Name__r.Email2__c);
                               Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
                               email.setToAddresses(emailAddress);
                               email.setSubject('Reminder For Pending Po Acknowledge '); 
                               email.setPlainTextBody('Dear User,' +' '+
                                                                'Your PO Number '+' '+wcb.Name +' ' + 'Pending For Acknowledge if Already Acknowledge then Ignore  this Mail otherwise Submit it immedietly.');
                                                      
                               emails.add(email);
                               system.debug('List Of Emails -->' + emails);
            
           
          }
       Messaging.sendEmail(emails);
      }
    
    global void finish(Database.BatchableContext BC){
   }
}