-
Notifications
You must be signed in to change notification settings - Fork 0
/
TaskTest.java
31 lines (26 loc) · 886 Bytes
/
TaskTest.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
//Tested by RJ Allen
import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
public class TaskTest {
private TaskList tasks = TaskList.getInstance();
private ArrayList<Comment> comment = new ArrayList<>();
@BeforeEach
public void setup() {
tasks.getInstance().geTasksList().clear();
DataWriter.saveTasks();
}
@AfterEach
public void tearDown() {
tasks.getInstance().geTasksList().clear();
DataWriter.saveTasks();
}
@Test
public void testAddValidTask() {
int initialSize = tasks.geTasksList().size();
tasks.addTask("Task", "taskDesc", 0, Category.BUG, comment, false, 0, null);
assertEquals(initialSize + 1, tasks.geTasksList().size());
}
}