forked from nus-cs2103-AY2223S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JUnit tests to test behavior of the code
- Loading branch information
Showing
5 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package duke; | ||
|
||
|
||
import duke.task.Deadline; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDate; | ||
import java.time.format.DateTimeFormatter; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class DeadlineTest { | ||
|
||
@Test | ||
public void toDoDeadline() { | ||
Deadline testDeadline = new Deadline("Return book", | ||
LocalDate.parse("2022-08-25", DateTimeFormatter.ofPattern("yyyy-MM-dd")), null); | ||
assertEquals(testDeadline.TaskInfo(), "[D] [ ] Return book (by:Aug 25 2022)"); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package duke; | ||
|
||
import duke.task.Event; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class EventTest { | ||
|
||
@Test | ||
public void testEvent() { | ||
Event testEvent = new Event("project meeting", "Mon 2-4pm"); | ||
assertEquals(testEvent.TaskInfo(), "[E] [ ] project meeting (at:Mon 2-4pm)"); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package duke; | ||
|
||
import duke.task.Task; | ||
|
||
import duke.task.ToDo; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class ToDoTest { | ||
|
||
@Test | ||
public void toDoTest() { | ||
Task testTask = new ToDo("Read book"); | ||
assertEquals(testTask.TaskInfo(), "[T] [ ] Read book"); | ||
} | ||
|
||
} |