Skip to content

Commit

Permalink
Add JUnit Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thutahw committed Aug 27, 2020
1 parent 1f1c6c5 commit 10c02e6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/DeadlineTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import org.junit.jupiter.api.Test;

import java.time.LocalDate;

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

class DeadlineTest {

@Test
void getStatusIcon() {
Deadline deadline = new Deadline("return book /by 2020-12-31", false, LocalDate.parse("2020-12-31"));
assertEquals("\u2718", deadline.getStatusIcon()) ;
}

}
14 changes: 14 additions & 0 deletions src/test/java/EventTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import org.junit.jupiter.api.Test;

import java.time.LocalDate;

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

class EventTest {

@Test
void getType() {
Event event = new Event("project meeting /at 2020-12-31", false, LocalDate.parse("2020-12-31"));
assertEquals("E", event.getType());
}
}
12 changes: 12 additions & 0 deletions src/test/java/TodoTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import org.junit.jupiter.api.Test;

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

class TodoTest {

@Test
void getDescription() {
Todo todo = new Todo("read book", false);
assertEquals("read book", todo.getDescription());
}
}

0 comments on commit 10c02e6

Please sign in to comment.