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
Navya sree 4Navya sree 4 

Code Coverage for Class?

Hi Everyone,
can you please provide test class for this class

global class ApprovalDelegationsSchedulable implements Schedulable {
    global void execute(SchedulableContext sc) {
        ApprovalDelegationsBatchable b = new ApprovalDelegationsBatchable();
        database.executebatch(b);
    }
}


Thanks you
Raj VakatiRaj Vakati
try this code
 
@isTest
public class ApprovalDelegationsSchedulable  {
    
    @isTest
    public static void testing() {
      
        Test.startTest();
        ApprovalDelegationsSchedulable  dlp = new ApprovalDelegationsSchedulable  ();
        String jobId = System.Schedule('ApprovalDelegationsSchedulable'+System.now(),'0 0 0 1 12 ? 2016',dlp);
        Test.stopTest();
        
        
    }

}

 
Raj VakatiRaj Vakati
@isTest
public class ApprovalDelegationsSchedulableTest  {
    
    @isTest
    public static void testing() {
      
        Test.startTest();
        ApprovalDelegationsSchedulable  dlp = new ApprovalDelegationsSchedulable  ();
        String jobId = System.Schedule('ApprovalDelegationsSchedulable'+System.now(),'0 0 0 1 12 ? 2016',dlp);
        Test.stopTest();
        
        
    }

}
 
global class ApprovalDelegationsSchedulable implements Schedulable {
    global void execute(SchedulableContext sc) {
        ApprovalDelegationsBatchable b = new ApprovalDelegationsBatchable();
        Database.executebatch(b);
    }