-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeekJsonTest.java
More file actions
62 lines (56 loc) · 1.86 KB
/
WeekJsonTest.java
File metadata and controls
62 lines (56 loc) · 1.86 KB
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
package cs3500.pa05.model.json;
import static org.junit.jupiter.api.Assertions.assertEquals;
import cs3500.pa05.model.DayType;
import java.util.ArrayList;
import java.util.List;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
/**
* Tests methods within a WeekJson.
*/
class WeekJsonTest {
private List<DayJson> days;
private List<TaskJson> tasks;
private WeekJson week;
/**
* Sets up fields for testing.
*/
@BeforeEach
public void setUp() {
List<EventJson> events = new ArrayList<>();
EventJson eventJson1 = new EventJson("Meeting", "Team meeting",
"Saturday", "10:00", "1 hour");
EventJson eventJson2 = new EventJson("Meeting", "Team meeting",
"Saturday", "10:00", "1 hour");
EventJson eventJson3 = new EventJson("Presentation", "Project presentation",
"Friday", "11:00", "2 hours");
events.add(eventJson1);
events.add(eventJson2);
events.add(eventJson3);
List<TaskJson> tasks2 = new ArrayList<>();
TaskJson taskJson1 = new TaskJson("Meeting", "Team meeting",
"Saturday", "true");
TaskJson taskJson2 = new TaskJson("Meeting", "Team meeting",
"Saturday", "true");
TaskJson taskJson3 = new TaskJson("Presentation", "Project presentation",
"Friday", "false");
tasks2.add(taskJson1);
tasks2.add(taskJson2);
tasks2.add(taskJson3);
DayJson day2 = new DayJson(DayType.FRIDAY, events, tasks2);
tasks = day2.tasks();
days = new ArrayList<>();
days.add(day2);
DayJson day1 = new DayJson(DayType.SATURDAY, events, tasks2);
days.add(day1);
week = new WeekJson("test", 5, 5, new ArrayList<>(),
new ThemeJson("neon"), days, tasks, "testing");
}
/**
* Tests the getter method.
*/
@Test
public void name() {
assertEquals("test", week.name());
}
}