forked from nus-cs2103-AY2324S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from licongshen12/parser-tests
Update tests for appointment commands
- Loading branch information
Showing
18 changed files
with
333 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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
src/test/java/seedu/address/logic/parser/ClearCommandParserTest.java
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,27 @@ | ||
package seedu.address.logic.parser; | ||
|
||
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import seedu.address.logic.commands.ClearCommand; | ||
import seedu.address.logic.parser.exceptions.ParseException; | ||
|
||
public class ClearCommandParserTest { | ||
private ClearCommandParser parser = new ClearCommandParser(); | ||
|
||
@Test | ||
public void parse_emptyArgs_returnsClearCommand() throws ParseException { | ||
// No arguments should return a ClearCommand | ||
ClearCommand expectedClearCommand = new ClearCommand(); | ||
assertParseSuccess(parser, "", expectedClearCommand); | ||
} | ||
|
||
@Test | ||
public void parse_nonEmptyArgs_throwsParseException() { | ||
assertParseFailure(parser, "some random string", | ||
String.format(MESSAGE_INVALID_COMMAND_FORMAT, ClearCommand.MESSAGE_USAGE)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/java/seedu/address/logic/parser/ExitCommandParserTest.java
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,27 @@ | ||
package seedu.address.logic.parser; | ||
|
||
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import seedu.address.logic.commands.ExitCommand; | ||
import seedu.address.logic.parser.exceptions.ParseException; | ||
|
||
public class ExitCommandParserTest { | ||
private ExitCommandParser parser = new ExitCommandParser(); | ||
|
||
@Test | ||
public void parse_emptyArgs_returnsExitCommand() throws ParseException { | ||
// No arguments should return an ExitCommand | ||
ExitCommand expectedExitCommand = new ExitCommand(); | ||
assertParseSuccess(parser, "", expectedExitCommand); | ||
} | ||
|
||
@Test | ||
public void parse_nonEmptyArgs_throwsParseException() { | ||
assertParseFailure(parser, "some random string", | ||
String.format(MESSAGE_INVALID_COMMAND_FORMAT, ExitCommand.MESSAGE_USAGE)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/test/java/seedu/address/logic/parser/HelpCommandParserTest.java
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,27 @@ | ||
package seedu.address.logic.parser; | ||
|
||
import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure; | ||
import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import seedu.address.logic.commands.HelpCommand; | ||
import seedu.address.logic.parser.exceptions.ParseException; | ||
|
||
public class HelpCommandParserTest { | ||
private HelpCommandParser parser = new HelpCommandParser(); | ||
|
||
@Test | ||
public void parse_emptyArgs_returnsHelpCommand() throws ParseException { | ||
// No arguments should return a HelpCommand | ||
HelpCommand expectedHelpCommand = new HelpCommand(); | ||
assertParseSuccess(parser, "", expectedHelpCommand); | ||
} | ||
|
||
@Test | ||
public void parse_nonEmptyArgs_throwsParseException() { | ||
assertParseFailure(parser, "some random string", | ||
String.format(MESSAGE_INVALID_COMMAND_FORMAT, HelpCommand.MESSAGE_USAGE)); | ||
} | ||
} |
Oops, something went wrong.