Skip to content

Commit

Permalink
A-JUnit
Browse files Browse the repository at this point in the history
  • Loading branch information
LimAiLin committed Aug 31, 2022
1 parent eb3f056 commit 4b81923
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/test/java/duke/task/DeadlineTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package duke.task;

import duke.DukeException;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class DeadlineTest {
@Test
public void toString_undone() throws DukeException {
Deadline deadline = new Deadline("description", "31/8/2022");
deadline.markAsUndone();
assertEquals("[D][ ] description (by: Aug 31 2022)", deadline.toString());
}

@Test
public void toString_done() throws DukeException {
Deadline deadline = new Deadline("description", "31/8/2022");
deadline.markAsDone();
assertEquals("[D][X] description (by: Aug 31 2022)", deadline.toString());
}
}
21 changes: 21 additions & 0 deletions src/test/java/duke/task/ToDoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package duke.task;

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;

public class ToDoTest {
@Test
public void toString_undone() {
ToDo todo = new ToDo("description");
todo.markAsUndone();
assertEquals("[T][ ] description", todo.toString());
}

@Test
public void toString_done() {
ToDo todo = new ToDo("description");
todo.markAsDone();
assertEquals("[T][X] description", todo.toString());
}
}

0 comments on commit 4b81923

Please sign in to comment.