高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@isTest
private class FixtureRemindSnapshotHandlerTest {
    static testMethod void testMethod1() {
        FixtureRemindSnapshot__c frs1 = new FixtureRemindSnapshot__c(Dai_Fen_Pei_Cnt__c = 1
                                                            , Region__c = '北方'
                                                            , Time__c ='14:00'
                                                            , Date__c = System.today()
                                                            ); 
        insert frs1;
        
        FixtureRemindSnapshot__c frs2 = [SELECT Name, UniqueKey__c FROM FixtureRemindSnapshot__c WHERE Id=:frs1.Id];
        System.assertEquals(System.now().format('yyyy-MM-dd') + ':14:00:北方', frs2.UniqueKey__c);
        System.assertEquals(System.now().format('yyyy-MM-dd') + ':14:00:北方', frs2.Name);
        frs2.Time__c = '15:00';
        frs2.Region__c = '南方';
        frs2.Date__c = System.today().addDays(1);
        update frs2;
 
        FixtureRemindSnapshot__c frs3 = [SELECT Name, UniqueKey__c FROM FixtureRemindSnapshot__c WHERE Id=:frs1.Id];
        System.assertEquals(System.now().addDays(1).format('yyyy-MM-dd') + ':15:00:南方', frs3.UniqueKey__c);
        System.assertEquals(System.now().addDays(1).format('yyyy-MM-dd') + ':15:00:南方', frs3.Name);
 
    }
}