-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventTest.java
27 lines (24 loc) · 950 Bytes
/
EventTest.java
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
@isTest
private class EventTest {
static testMethod void test_event() {
Campaign c = RollCallTestUtility.createEventCampaign();
Event e = new Event(c);
Campaign d;
for (Integer i = 0; i < 12; i++) {
d = new Campaign(name='TestEvent', StartDate=Date.today().AddMonths(i));
e = new Event(d, i);
}
d = new Campaign(name='TestEvent', StartDate=Date.today().AddDays(2));
e = new Event(d, 1);
System.assertEquals(e.name, d.name);
}
static testMethod void test_event2() {
Campaign c = new Campaign(name='Parent', isActive=true, MaxCapacity__c = 1);
insert c;
Event e = new Event(c, 0);
c = new Campaign(name='Parent', isActive=true, MaxCapacity__c = 1, StartDate=Date.today().AddMonths(1));
new Event(c);
c = new Campaign(name='Parent', isActive=true, MaxCapacity__c = 1);
new Event(c);
}
}