-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTEST_UTIL_System_assertDateSetEquals.cls
47 lines (40 loc) · 1.38 KB
/
TEST_UTIL_System_assertDateSetEquals.cls
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
@isTest(SeeAllData = false)
private class TEST_UTIL_System_assertDateSetEquals
{
static testMethod void doTest()
{
Test.startTest();
Set<Date> set1 = new Set<Date>();
set1.add(system.today());
Set<Date> set2 = new Set<Date>();
set2.add(system.today());
String message = DAL_BaseObject.generateRandomName();
try
{
UTIL_System.assertDateSetEquals(set1, new Set<Date>(), message);
system.assert(false, 'TEST 0. Dates are not equal. This exception must be thrown.');
}
catch(UTIL_System.AssertionException anAssertionException)
{
}
try
{
UTIL_System.assertDateSetEquals(set1, set2, message);
}
catch(UTIL_System.AssertionException anAssertionException)
{
system.assert(false, 'TEST 1. Dates are equal. This exception must be not thrown.');
}
try
{
set2 = new Set<Date>();
set2.add(system.today().addDays(1));
UTIL_System.assertDateSetEquals(set1, set2, message);
system.assert(false, 'TEST 2. Dates are not equal. This exception must be thrown.');
}
catch(UTIL_System.AssertionException anAssertionException)
{
}
Test.stopTest();
}
}