Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Add VergilTest.java
Browse files Browse the repository at this point in the history
  • Loading branch information
riyadh-h committed Jan 26, 2021
1 parent 4db502a commit d4579d9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/VergilTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class VergilTest {
TaskList taskList = new TaskList();

@Test
public void addTodo() {
taskList.add(new Todo("A to-do task"));
assertEquals(
"1. [T][ ] A to-do task\n",
taskList.toString());
}

@Test
public void completeTodo() {
taskList.add(new Todo("A to-do task"));
try {
taskList.complete(1);
} catch (VergilException e) {
// Do nothing.
} finally {
assertEquals(
"1. [T][X] A to-do task\n",
taskList.toString());
}
}
}

0 comments on commit d4579d9

Please sign in to comment.