-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCampListTest.java
50 lines (42 loc) · 1 KB
/
CampListTest.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
/**
* @author Caleb Martin
*/
import static org.junit.jupiter.api.Assertions.*;
import java.util.UUID;
import org.junit.*;
public class CampListTest
{
private static CampList campList;
private static Camp testCamp;
@BeforeClass
public static void oneTimeSetup()
{
campList = CampList.getInstance();
testCamp = new Camp("Test");
}
@Test
public void testGetInstance()
{
assertNotNull(campList);
}
@Test
public void testAddCamp()
{
int listSize = campList.getCamps().size();
campList.addCamp(testCamp);
assertEquals(listSize+1, campList.getCamps().size());
}
@Test
public void testAddCamp2()
{
int listSize = campList.getCamps().size();
campList.addCamp(testCamp);
assertNotEquals(listSize+1, campList.getCamps().size());
}
@Test
public void testAddCampData()
{
campList.addCamp(testCamp);
assertEquals(testCamp, campList.getCamps().get(0));
}
}