高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
1
2
3
4
5
6
7
8
9
10
11
12
13
@isTest
private class FixtureRemindSnapshotScheduleTest {
    @isTest static void test_method_one() {
        String CRON_EXP = '0 0 0 3 9 ? 2022';
        System.Test.startTest();
        String jobId = system.schedule('FixtureRemindSnapshotScheduleTest', CRON_EXP, new FixtureRemindSnapshotSchedule());
        CronTrigger ct = [SELECT Id, CronExpression, TimesTriggered, NextFireTime FROM CronTrigger WHERE id = :jobId];
        System.assertEquals(CRON_EXP, ct.CronExpression);
        System.assertEquals(0, ct.TimesTriggered);
        System.assertEquals('2022-09-03 00:00:00', String.valueOf(ct.NextFireTime));
        System.Test.stopTest();
    }
}