高章伟
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
32
33
34
@isTest
private class ConsumApplyWebServiceTest {
 
    // 造出已出库申请
    static testMethod void testReceiveAll() {
        ConsumTestDataFactory factory = new ConsumTestDataFactory();
        factory.setupTestData();
        factory.selectDetails();
        factory.approve();
        factory.defaultAssign();
        factory.shippmentRequest();
        factory.shipment();
 
        Consum_Apply__c ca = [SELECT Id FROM Consum_Apply__c LIMIT 1];
        List<Consum_Apply_Equipment_Set_Detail__c> caesdList = null;
        caesdList = [SELECT Received_Confirm__c
                          , Loaner_received_time__c
                       FROM Consum_Apply_Equipment_Set_Detail__c];
        System.assertEquals(null, caesdList[0].Received_Confirm__c);
        System.assertEquals(null, caesdList[0].Loaner_received_time__c);
        Test.startTest();
        ConsumApplyWebService.all_received_fse(ca.Id);
        Test.stopTest();
        caesdList = [SELECT Received_Confirm__c
                          , Loaner_received_time__c
                       FROM Consum_Apply_Equipment_Set_Detail__c];
        System.assertEquals('OK', caesdList[0].Received_Confirm__c);
        System.assertNotEquals(null, caesdList[0].Loaner_received_time__c);
    }
 
    static testMethod void testCoverUp() {
        ConsumApplyWebService.test();
    }
}