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
@isTest
public with sharing class LexCommitNeedApprovalControllerTest {
    static testMethod void testMethod1() {
        RecordType rectCam =
        [select Id from RecordType
         where IsActive = true and SobjectType = 'Campaign'
                          and DeveloperName = 'ServiceEngineerTraining'];
 
        Campaign cam = new Campaign();
        cam.Name = 'camTest';
        cam.Name2__c = '1234Test';
        cam.RecordTypeId = rectCam.Id;
        cam.StartDate = Date.today().addDays(-15);
        cam.EndDate = Date.today().addDays(18);
        cam.Mailflg_after45__c = true;
        cam.Mailflg_cancel__c = true;
        cam.Mailflg_before15__c = true;
        cam.Mailflg_before7__c = true;
        cam.Mailflg_after3__c = true;
        cam.Status = '申请中';
        insert cam;
 
        //需要一个meetings 的对象集合
        meeting_delay_apply__c m = new meeting_delay_apply__c();
        m.Meeting_Type__c = '共同主办会';
        m.HostName__c = '主办方Test';
        m.cooperatorCompany__c = '承办方Test';
        m.status__c = '草案中';
        m.campaign__c = cam.Id;
        insert m;
        LexCommitNeedApprovalController.init(m.Id);
        LexCommitNeedApprovalController.init('xxx72727');
        LexCommitNeedApprovalController.newUpdateMeetingDelayApply(m.Id);
        LexCommitNeedApprovalController.newUpdateMeetingDelayApply('xcacxc');
        LexCommitNeedApprovalController.getCampaignById(cam.Id);
        LexCommitNeedApprovalController.getCampaignById('xxx123333');
    }
}