高章伟
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
@isTest
private class DateModifyControllerTest {
 
    @isTest static void test_method_one() {
        list<Campaign> Campaignlist = new list<Campaign>();
        Campaign cam = new Campaign();
        cam.Name = 'cam';
        cam.StartDate = Date.today().addDays(15);
        cam.EndDate = Date.today().addDays(18);
        cam.Name2__c = '1234';
        cam.Status = '公开中';
        cam.IsOpenCeremony__c = '是';
        cam.CeremonyDate__c = Date.today();
        
        cam.CeremonyDate_copy__c = Date.today().addDays(15);
          
        cam.CeremonyLeaders__c = '123';
        Campaignlist.add(cam);
 
 
        Campaign cam1 = new Campaign();
        cam1.Name = 'cam';
        cam1.StartDate = Date.today().addDays(15);
        cam1.EndDate = Date.today().addDays(18);
        cam1.Name2__c = '1234';
        cam1.Status = '公开中';
        cam1.IsOpenCeremony__c = '否';
        Campaignlist.add(cam1);
 
        Campaign cam2 = new Campaign();
        cam2.Name = 'cam';
        cam2.StartDate = Date.today().addDays(15);
        cam2.EndDate = Date.today().addDays(18);
        cam2.CeremonyDate_copy__c = Date.today().addDays(15);
         cam2.Name2__c = '1234';
        cam2.Status = '公开中';
        cam2.IsOpenCeremony__c = '否';
        Campaignlist.add(cam2);
 
        Campaign cam3 = new Campaign();
        cam3.Name = 'cam';
        cam3.StartDate = Date.today().addDays(15);
        cam3.EndDate = Date.today().addDays(18);
        cam3.CeremonyDate_copy__c = Date.today().addDays(15);
        cam3.Name2__c = '1234';
        cam3.Status = '公开中';
        cam3.IsOpenCeremony__c = '否';
        Campaignlist.add(cam3);
 
        Campaign cam4 = new Campaign();
        cam4.Name = 'cam';
        cam4.StartDate = Date.today().addDays(15);
        cam4.EndDate = Date.today().addDays(18);
        cam4.CeremonyDate_copy__c = Date.today().addDays(18);
        cam4.Name2__c = '1234';
        cam4.Status = '公开中';
        cam4.IsOpenCeremony__c = '否';
        Campaignlist.add(cam4);
        
        Campaign cam5 = new Campaign();
        cam5.Name = 'cam';
        cam5.StartDate = Date.today().addDays(15);
        cam5.EndDate = Date.today().addDays(18);
        cam5.Name2__c = '1234';
        cam5.Status = '公开中';
        cam5.IsOpenCeremony__c = '是';
       cam5.CeremonyDate__c = Date.today();
        cam5.CeremonyDate_copy__c = Date.today().addDays(15);
       
        cam5.CeremonyLeaders__c = '123';
        Campaignlist.add(cam5);
        insert Campaignlist;
        
        
        DateModifyController d = new DateModifyController();
        d.coId = cam.id;
        d.init();
        d.saveBtn();
        d.submitBtn();
 
        DateModifyController d1 = new DateModifyController();
        d1.coId = cam1.id;
        d1.init();
        d1.saveBtn();
        d1.submitBtn();
        
        DateModifyController d2 = new DateModifyController();
        d2.coId = cam2.id;
        d2.init();
        d2.saveBtn();
        d2.submitBtn();
        System.Test.startTest();
        DateModifyController d3 = new DateModifyController();
        d3.coId = cam3.id;
        d3.init();
        d3.saveBtn();
        d3.submitBtn();
 
        DateModifyController d4 = new DateModifyController();
        d4.coId = cam4.id;
        d4.init();
        d4.saveBtn();
        d4.submitBtn();
 
 
        DateModifyController d5 = new DateModifyController();
        d5.coId = cam5.id;
        d5.init();
        d5.saveBtn();
        d5.submitBtn();
        System.Test.stopTest();
    }
    @isTest static void testsetUpEmailStr() {
        Campaign cam = new Campaign();
        cam.Name = 'cam';
        cam.StartDate__c = Date.today().addDays(15);
        cam.CeremonyDate_copy__c = Date.today().addDays(13);
 
 
        cam.Lesson1Date__c = Date.today().addDays(15);
        cam.Lesson1Date_copy__c = Date.today().addDays(13);
 
        cam.Lesson2Date__c = Date.today().addDays(15);
        cam.Lesson2Date_copy__c = Date.today().addDays(13);
 
        cam.Lesson3Date__c = Date.today().addDays(15);
        cam.Lesson3Date_copy__c = Date.today().addDays(13);
 
 
        cam.Lesson4Date__c = Date.today().addDays(15);
        cam.Lesson4Date_copy__c = Date.today().addDays(13);
 
 
        cam.Lesson5Date__c = Date.today().addDays(15);
        cam.Lesson5Date_copy__c = Date.today().addDays(13);
 
        cam.Lesson6Date__c = Date.today().addDays(15);
        cam.Lesson6Date_copy__c = Date.today().addDays(13);
 
        cam.Lesson7Date__c = Date.today().addDays(15);
        cam.Lesson7Date_copy__c = Date.today().addDays(13);
 
        cam.Lesson8Date__c = Date.today().addDays(15);
        cam.Lesson8Date_copy__c = Date.today().addDays(13);
 
 
        cam.FinalExamDate__c = Date.today().addDays(15);
        cam.FinalExamDate_copy__c = Date.today().addDays(13);
 
        DateModifyController d = new DateModifyController();
        d.cam = cam;
        d.setUpEmailStr();
    }
 
}