Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
JUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanTheGoondu committed Aug 26, 2020
1 parent fb99c32 commit c16a961
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions src/test/java/TaskListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,28 @@ public class TaskListTest {


@Test
public void descTestOne() throws DukeEmptyDescException {
public void listTest() throws DukeEmptyDescException {
TaskList taskList = new TaskList();
taskList.addTask(new Task("Hi", TaskType.TODO, false), false);
assertEquals(taskList.toString(), "Here are the tasks in your list:\n" +
"1.[✘] Hi\n");
}

@Test
public void descTestTwo() throws DukeEmptyDescException {
public void listTest2() throws DukeEmptyDescException {
TaskList taskList = new TaskList();
taskList.addTask(new Task("Hello", TaskType.TODO, true), false);
assertEquals(taskList.toData(),"[✓] Hello\n");
}

@Test
public void listTest3() throws DukeException {
TaskList taskList = new TaskList();
taskList.addTask(new Task("Hi", TaskType.TODO, false), false);
taskList.addTask(new Deadline("Deadline", " 12-12-1212 1212", false), false);
assertEquals(taskList.toString(), "Here are the tasks in your list:\n" +
"1.[✘] Hi\n" +
"2.[D][✘] Deadline(by: 12-12-1212 1212)\n");
}

}
4 changes: 2 additions & 2 deletions src/test/java/TodoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

public class TodoTest {
@Test
public void descTestOne() throws DukeEmptyDescException {
public void descTest() throws DukeEmptyDescException {
assertEquals(new Task("Hi", TaskType.TODO, false).toString(), "[✘] Hi");
}

@Test
public void descTestTwo() throws DukeEmptyDescException {
public void descTest2() throws DukeEmptyDescException {
assertEquals(new Task("Hello There!", TaskType.TODO, true).toString(), "[✓] Hello There!");
}

Expand Down

0 comments on commit c16a961

Please sign in to comment.