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
4 changed files
with
67 additions
and
1 deletion.
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,38 @@ | ||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.fail; | ||
|
||
public class ParserTest { | ||
Parser p = new Parser(); | ||
|
||
@Test | ||
public void testGetTaskNumber() { | ||
assertEquals(1, p.getTaskNumber( "done 1")); | ||
assertEquals(17, p.getTaskNumber( "delete 17")); | ||
assertEquals(299, p.getTaskNumber( "done 299")); | ||
} | ||
|
||
@Test | ||
public void testCommandToTask_completeInput_success() throws IncompleteInputException { | ||
assertEquals(new Todo("eat"), p.commandToTask("todo eat")); | ||
/*assertEquals(new Deadline("homework", "2020-08-30"), | ||
p.commandToTask("deadline homework /by 2020-08-30")); | ||
assertEquals(new Event("birthday", "2020-12-04"), | ||
p.commandToTask("event birthday /at 2020-12-4"));*/ | ||
} | ||
|
||
@Test | ||
public void testCommandToTask_incompleteInput_exceptionThrown() throws IncompleteInputException { | ||
try { | ||
assertEquals(new Todo("eat"), p.commandToTask("todo")); | ||
fail(); // the test should not reach this line | ||
} catch (Exception e) { | ||
assertEquals("please finish your sentence.. :(\neither your task name is blank " + | ||
"or youre missing the time!!", e.getMessage()); | ||
} | ||
/*assertEquals(new Deadline("homework", "2020-08-30"), | ||
p.commandToTask("deadline homework /by 2020-08-30")); | ||
assertEquals(new Event("birthday", "2020-12-04"), | ||
p.commandToTask("event birthday /at 2020-12-4"));*/ | ||
} | ||
} |
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,14 @@ | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.util.Scanner; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class UiTest { | ||
Ui ui = new Ui(new Scanner(System.in)); | ||
|
||
@Test | ||
public void dummyTest(){ | ||
assertEquals(2, 2); | ||
} | ||
} |