-
Notifications
You must be signed in to change notification settings - Fork 0
/
CabinListTest.java
80 lines (66 loc) · 1.76 KB
/
CabinListTest.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/**
* @author Caleb Martin
*/
import static org.junit.jupiter.api.Assertions.*;
import java.util.UUID;
import org.junit.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.condition.DisabledIf;
public class CabinListTest
{
private static ChildList childList;
private static UserList userList;
private static CabinList cabinList;
@BeforeClass
public static void oneTimeSetup()
{
childList = ChildList.getInstance();
userList = UserList.getInstance();
cabinList = CabinList.getInstance();
}
@AfterClass
public static void oneTimeTeardown()
{
}
@Test
public void testGetInstance()
{
assertNotNull(cabinList);
}
@Test
public void testDataAfterGetInstance()
{
assertNotNull(cabinList.getCabins());
}
@Test
public void testListHasCabins()
{
assertNotEquals(0, cabinList.getCabins().size());
}
@Test
public void testGetReadCabin()
{
Cabin gottenCabin = cabinList.getCabin(UUID.fromString("dd30acc7-6e51-4174-9fd0-4f345915fbe8"));
assertNotNull(gottenCabin);
}
@Test
public void testAddCabin()
{
int cabinListSize = cabinList.getCabins().size();
cabinList.addCabin("Test");
assertEquals(cabinListSize+1, cabinList.getCabins().size());
}
@Test
public void testGetExistingCabin()
{
Cabin cabinToGet = cabinList.getCabins().get(0);
assertEquals(cabinToGet, cabinList.getCabin(cabinToGet.getUUID()));
}
@Test
public void testAddNull()
{
int cabinListSize = cabinList.getCabins().size();
cabinList.addCabin(null);
assertNotEquals(cabinListSize+1, cabinList.getCabins().size());
}
}