D C
2023-05-26 9a0ef802a678ffc421fc1d416f7f867e89e5536a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@isTest
private class ConsumAutoSelectBatchScheduleTest {
    
    @isTest static void test_method() {
        // Implement test code
        String CRON_EXP = '0 0 0 3 9 ? 2024';
         System.Test.startTest();
        // Schedule the test job
        String jobId = system.schedule('ConsumAutoSelectBatchScheduleTest', CRON_EXP, new ConsumAutoSelectBatchSchedule());
        // Get the information from the CronTrigger API object
        CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
        // Verify the expressions are the same
        System.assertEquals(CRON_EXP, ct.CronExpression);
        // Verify the job has not run
        // System.assertEquals(0, ct.TimesTriggered);
        // Verify the next time the job will run
        System.assertEquals('2024-09-03 00:00:00', String.valueOf(ct.NextFireTime));
 
        System.Test.StopTest();
    }
    
}