-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathAndConditionTest.cls
30 lines (25 loc) · 1010 Bytes
/
AndConditionTest.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
@IsTest
private class AndConditionTest {
private static testmethod void testAndConditionEmpty(){
System.assertEquals('',new AndCondition().toSoql());
}
private static testmethod void testNestedAndConditionEmpty(){
System.assertEquals('',new AndCondition().add(new AndCondition()).add(new AndCondition()).toSoql());
}
private static testmethod void testAndConditionWithOneConditionOnly(){
System.assertEquals(
'name = \'acme\'',
new AndCondition()
.add(new FieldCondition('name ',Operator.EQUALS,'acme'))
.toSoql());
}
private static testmethod void testTwoFieldConditions(){
System.assertEquals(
'(name = \'acme\' AND ispartner = true)',
new AndCondition()
.add(new FieldCondition('name ',Operator.EQUALS,'acme'))
.add(new FieldCondition('ispartner',Operator.EQUALS,true))
.toSoql()
);
}
}