liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
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
35
36
37
38
39
@Istest
public class lexConsumApplyControllerTest {
    static testMethod void testMethod01(){
        // 学会
        List<Id> recordTypeIds = new List<Id>();
        recordTypeIds.add(Schema.SObjectType.Campaign.getRecordTypeInfosByDeveloperName().get('Society').getRecordTypeId()); //学会/会议
        Campaign campaign01 = new Campaign();
        campaign01.RecordTypeId = recordTypeIds.get(0);
        campaign01.StartDate = Date.newInstance(2020,10,29);
        campaign01.Name = 'Test';
        campaign01.EndDate = Date.newInstance(2020,10,30);
        campaign01.Status = '草案中';
        campaign01.Is_LendProduct__c = '是';
        campaign01.PlanBackData__c = Date.newInstance(2020,11,30);       //计划撤展日期
        campaign01.LoadNum__c = '3D主机*2; BF-290镜子*4; CV-170*1; CV-190*6;';   //计划出借备品信息
        campaign01.HostName__c = '1';
        campaign01.cooperatorCompany__c = '1';
        insert campaign01;
 
        //耗材备品申请
        Consum_Apply__c ca = new Consum_Apply__c();
        ca.Name = 'XXXX-YYYY_ZZZZ_1';
        ca.Status__c = '批准';
        ca.Campaign__c = campaign01.id;
        ca.DataMigration_Flag__c = true;
        insert ca;
        lexConsumApplyController.init(ca.id);
 
        Consum_Apply_Equipment_Set__c caes = new Consum_Apply_Equipment_Set__c();
        caes.Consum_Apply__c = ca.Id;
        caes.Consum_Start_Date__c = Date.today().addDays(20);
        caes.DataMigration_Flag__c = true;
        insert caes;
        lexConsumApplyController.getLength1(ca.id);
        lexConsumApplyController.getLength2(ca.id);
        lexConsumApplyController.getSet(caes.id);
 
   }
}