forked from nus-cs2103-AY2021S1/ip
-
Notifications
You must be signed in to change notification settings - Fork 1
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
yuming7144
committed
Aug 25, 2020
1 parent
7be74a9
commit 15b818a
Showing
2 changed files
with
40 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,22 @@ | ||
package duke; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class ParserTest { | ||
@Test | ||
void parseCommand_Parser_Test() { | ||
try { | ||
Parser.parseCommand("deadline"); | ||
} catch (DukeException e) { | ||
assertEquals("The description of a deadline cannot be empty.", e.getMessage()); | ||
} | ||
} | ||
|
||
@Test | ||
void stopProgram_Parser_Test() { | ||
assertTrue(Parser.stopProgram("bye")); | ||
} | ||
} |
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.task; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertArrayEquals; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class TodoTest { | ||
@Test | ||
void taskToArray_ToDo_Test() { | ||
Todo todo = new Todo("Return book"); | ||
String[] expected_arr = new String[]{"T", "1", "Return book"}; | ||
assertArrayEquals(expected_arr, todo.taskToArray()); | ||
} | ||
|
||
|
||
|
||
} |