-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserRecordApplicationTest.java
46 lines (34 loc) · 1.06 KB
/
UserRecordApplicationTest.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package STassgn;
import static org.junit.Assert.*;
import java.util.ArrayList;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import junitparams.JUnitParamsRunner;
@RunWith(JUnitParamsRunner.class)
public class UserRecordApplicationTest {
UserRecordApplication ura;
@Before
public void setup() {
ura = new UserRecordApplication();
ura.initializeUsers();
}
@Test
public void testInitializeUsers() {
ArrayList<User> users = ura.getUserRecords();
assertNotNull(users);
assertEquals(3, users.size());
User user1 = users.get(0);
assertEquals("John", user1.getName());
assertEquals("VIP", user1.getMemberType());
assertEquals(false, user1.getExclReward());
User user2 = users.get(1);
assertEquals("Alice", user2.getName());
assertEquals("Normal", user2.getMemberType());
assertEquals(true, user2.getExclReward());
User user3 = users.get(2);
assertEquals("Bob", user3.getName());
assertEquals("Non-member", user3.getMemberType());
assertEquals(false, user3.getExclReward());
}
}