Skip to content

Commit

Permalink
Add JUnit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengweii committed Aug 27, 2020
1 parent ecfa777 commit 62e43ab
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/test/java/TaskTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TaskTest {
@Test
public void getTaskDescription (){
assertEquals("Borrow book", new Task("Borrow book").getDescription());
}

@Test
public void getDoneStatus() {
assertEquals(false, new Task("Borrow book").getDoneStatus());
}

@Test
public void getDoneStatusAfterMarkAsCompleted() {
Task task = new Task("Borrow book");
task.markAsDone();
assertEquals(true, task.getDoneStatus());
}
}

0 comments on commit 62e43ab

Please sign in to comment.