From d000fe9041b420582c2af4800204cc90ca1fba60 Mon Sep 17 00:00:00 2001 From: koonweee <34903259+koonweee@users.noreply.github.com> Date: Wed, 26 Aug 2020 02:40:13 +0800 Subject: [PATCH] Add JUnit Tests --- src/test/data/tasks.txt | 0 src/test/java/TodoTest.java | 17 ++++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/test/data/tasks.txt diff --git a/src/test/data/tasks.txt b/src/test/data/tasks.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/test/java/TodoTest.java b/src/test/java/TodoTest.java index 385a74c15c..59ee43b612 100644 --- a/src/test/java/TodoTest.java +++ b/src/test/java/TodoTest.java @@ -1,4 +1,19 @@ -package PACKAGE_NAME; +import org.junit.Test; + +import java.io.IOException; + +import static org.junit.jupiter.api.Assertions.assertEquals; public class TodoTest { + @Test + public void testTodo() { + Todo testTodo = new Todo("Todo 1"); + assertEquals("[T][✗] Todo 1",testTodo.toString()); + } + @Test + public void testTodoDone() { + Todo testTodo = new Todo("Todo 1"); + testTodo.setDone(); + assertEquals("[T][✓] Todo 1",testTodo.toString()); + } }