Skip to content

Commit

Permalink
Add junit test to class TestList
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang-Quan committed Aug 29, 2022
1 parent 2390b2f commit f75604a
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/test/java/tasklist/TaskListTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package tasklist;

import org.junit.jupiter.api.Test;
import task.Todo;

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

public class TaskListTest {
@Test
public void markTest(){
TaskList currTask = new TaskList();
currTask.addTask(new Todo("Testing"));
String actual = currTask.mark(0);
assertEquals("\t [T][X] Testing\n", actual);
}

@Test
public void unmarkTest(){
TaskList currTask = new TaskList();
currTask.addTask(new Todo("Testing"));
currTask.mark(0);
String actual = currTask.unmark(0);

assertEquals("\t [T][ ] Testing\n", actual);
}
}

0 comments on commit f75604a

Please sign in to comment.