高章伟
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
25
26
27
28
29
30
31
@isTest
private class FixtureRemindUtilTest {
    @isTest(SeeAllData=true) 
    static void testMethod1() {
        OlympusCalendar__c today = [SELECT Before_1_WorkDay__c FROM OlympusCalendar__c WHERE Date__c=:System.today()];
        List<Rental_Apply_Equipment_Set_Detail__c> raesdList = [
            SELECT RAESD_Status_Text__c
                 , Rental_Apply__r.Loaner_centre_mail_address__c
                 , Lost_item_check_time_Final__c
                 , Repair_Status_F__c
                 , Return_DeliverySlip__c
              FROM Rental_Apply_Equipment_Set_Detail__c
             WHERE ((Is_Body_F__c = true 
                       AND ((RAESD_Status_Text__c = '欠品中' AND Return_DeliverySlip__c != null)
                            OR (RAESD_Status_Text__c = '修理中' AND Repair_Status_F__c = '修理完毕')
                        )
                    )
                OR (RAESD_Status_Text__c = '欠品中' AND Lost_item_check_time_Final__c >= :today.Before_1_WorkDay__c)
                OR (RAESD_Status_Text__c = '待修理' AND Is_Body_F__c = false))
                AND Rental_Apply__r.RecordType.DeveloperName != 'AgencyRequest' limit 1];
 
 
        System.Test.startTest();
        FixtureRemindUtil util = new  FixtureRemindUtil();
        util.init();
        util.createSnapshotRecord('华东');
        util.createSnapshotRecord('南方');
        util.createSnapshotRecord('北方');
        System.Test.stopTest();
    }
}