-
Notifications
You must be signed in to change notification settings - Fork 1
/
ConcatTest.apxc
29 lines (27 loc) · 1008 Bytes
/
ConcatTest.apxc
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
@isTest
public class ConcatTest {
static testmethod void test1() {
String f1 = 'Vasya';
String f2 = 'Petro';
String f3 = null;
String f4 = 'Andrew';
String result = 'Hello my dear friends: ' + concat.strings(f1,f2,f3).add(f4).add(null).with(', ').end('!');
system.assertEquals(result, 'Hello my dear friends: Vasya, Petro, Andrew!');
}
static testmethod void test2() {
String result = concat.strings().add(null).with(', ').end();
system.assertEquals(result, '');
}
static testmethod void test3() {
concat.strings();
concat.strings('');
concat.strings('', '');
concat.strings('', '', '');
concat.strings('', '', '', '');
concat.strings('', '', '', '', '');
concat.strings('', '', '', '', '', '');
concat.strings('', '', '', '', '', '', '');
concat.strings('', '', '', '', '', '', '', '');
concat.strings(new List<String>());
}
}