forked from nus-cs2103-AY2021S1/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.
- Loading branch information
Showing
5 changed files
with
83 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class DeadlineTest { | ||
|
||
@Test | ||
public void testStringConversion() { | ||
assertEquals("[D][not done] return book (by: 12 June 2019 6:00 PM)", | ||
new Deadline("return book", false, | ||
LocalDateTime.of(2019, 6, 12, 18, 0)).toString()); | ||
} | ||
} |
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,15 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class EventTest { | ||
|
||
@Test | ||
public void testStringConversion() { | ||
assertEquals("[E][not done] dance auditions (at: 30 September 2020 11:30 AM)", | ||
new Event("dance auditions", false, | ||
LocalDateTime.of(2020, 9, 30, 11, 30)).toString()); | ||
} | ||
} |
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,24 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class ParserTest { | ||
@Test | ||
public void processMsg_invalidCommand_exceptionThrown() { | ||
try { | ||
Parser p = new Parser(new TaskList()); | ||
p.processMsg("test"); | ||
} catch (Exception e) { | ||
assertEquals("Specified action is not recognised.", e.getMessage()); | ||
} | ||
} | ||
|
||
@Test | ||
public void processDate_validDate_success() throws DukeException { | ||
Parser p = new Parser(new TaskList()); | ||
LocalDateTime test = p.processDate("5/2/2020 1821"); | ||
assertEquals(LocalDateTime.of(2020, 2, 5, 18, 21), test); | ||
} | ||
} |
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 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class TaskTest { | ||
@Test | ||
public void testStringConversion() { | ||
assertEquals("[not done] read book", new Task("read book", false).toString()); | ||
} | ||
|
||
@Test | ||
public void markAsComplete_incompleteTask_success() { | ||
Task testTask = new Task("read book", false); | ||
testTask.markAsComplete(); | ||
assertTrue(testTask.getStatus()); | ||
} | ||
} |
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,11 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class TodoTest { | ||
|
||
@Test | ||
public void testStringConversion() { | ||
assertEquals("[T][not done] read book", new Todo("read book", false).toString()); | ||
} | ||
} |