Skip to content

Commit

Permalink
Merge pull request #241 from carrieng0323852/master
Browse files Browse the repository at this point in the history
updated command summary of ug
  • Loading branch information
carrieng0323852 authored Nov 10, 2019
2 parents 8461158 + 905c6b6 commit ca236ec
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 32 deletions.
28 changes: 18 additions & 10 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -479,18 +479,24 @@ the software at our https://github.com/AY1920S1-CS2113T-T09-3/main/releases[rele
* *hello* `hello`
* *menu* : `menu`
* *chapters* : `chapters`
* *select* : `select CHAPTER`
e.g. `select sorting`
* *quiz* : `quiz`
* *quiz ANSWER* : `ANSWER`
* *quiz BACK* : `back`
* *quiz NEXT* : `next`
* *quiz END* : `end`
* *lecture* : `lecture CHAPTER` +
e.g. `lecture sorting`
* *quiz* : `quiz CHAPTER` +
e.g. `quiz sorting`
* *arcade* : `arcade`
* *start* : `start`
* *next* : `next`, can only be used during a lecture/quiz
* *back* : `back`, can only be used during a lecture/quiz
* *end* : `end`, can only be used during a lecture/quiz
* *answer*: `<answer separated by ", ">` +
e.g. `40, 50, 30`
* *result* : `result`
* *review* : `review QUESTION_NUMBER` +
e.g. `review 6`
* *history* : `history NUMBER` +
e.g. `history 5`
* *Undo* : `undo NUMBER` +
e.g. `undo` or `undo 4`
* *undo* : `undo || undo NUMBER` +
e.g. `undo` gives a default NUMBER as 1 or `undo 4`
* *clear* : `clear`
* *help* : `help CHAPTER` +
e.g. `help sorting`
Expand All @@ -500,6 +506,8 @@ e.g. `volume 1`
e.g `print user MyData.pdf`
* *archive* : `archive QUESTION_NUMBER` +
e.g. `archive 1`
* *save* : `save`
* *load* : `load <filename>.txt` +
e.g. `load UserData.txt`
* *stats* : `stats`
* *reset* : `reset`
* *exit* : `exit`
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public enum CommandsEnum {
volume, //11
print, //12
archive, //13
save, //14
stats, //15
result,//16
exit, //17
load; //18
load, //18
start; //19

private static List<String> enumNames = Stream.of(CommandsEnum.values())
.map(CommandsEnum::name)
Expand All @@ -47,7 +47,7 @@ public static List<String> getNames() {
*/
public static List<String> getQuizBlockedNames() {
List<String> blockedNames = new LinkedList<>(enumNames);
blockedNames.remove(16); //exit
blockedNames.remove(17); //exit
blockedNames.remove(11); //volume
blockedNames.remove(2); //quiz
return blockedNames;
Expand All @@ -59,7 +59,7 @@ public static List<String> getQuizBlockedNames() {
*/
public static List<String> getLectureBlockedNames() {
List<String> blockedNames = new LinkedList<>(enumNames);
blockedNames.remove(16); //exit
blockedNames.remove(17); //exit
blockedNames.remove(11); //volume
blockedNames.remove(1); //lecture
return blockedNames;
Expand All @@ -71,7 +71,7 @@ public static List<String> getLectureBlockedNames() {
*/
public static List<String> getArcadeBlockedNames() {
List<String> blockedNames = new LinkedList<>(enumNames);
blockedNames.remove(16); //exit
blockedNames.remove(17); //exit
blockedNames.remove(11); //volume
blockedNames.remove(3); //arcade
return blockedNames;
Expand Down
16 changes: 0 additions & 16 deletions src/test/java/com/algosenpai/app/commands/InvalidCommandTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,6 @@ void testInvalidWithMinEditDistance() throws IOException, FileParsingException {
}
}

@Test
void testInvalidWithMultipleMinEditDistance() throws IOException, FileParsingException {
UserStats previousStats = UserStats.parseString(Storage.loadData("UserData.txt"));
Logic logic = new Logic(previousStats);
Command command = logic.executeCommand("ter");
String actualText = command.execute();
if (previousStats.getUsername().equals("Default")) {
Assertions.assertEquals("Hello there! Welcome to the world of DATA STRUCTURES AND ALGORITHMS.\n"
+ "Can I have your name and gender in the format : "
+ "'hello NAME GENDER (boy/girl)' please.", actualText);
} else if (!previousStats.getUsername().equals("Default")) {
Assertions.assertEquals("OOPS!!! Error occurred. Please input a valid command. Did you mean... "
+ "menu, clear, help?", actualText);
}
}

@Test
void testInvalidWithCharacterAbsentFromAllCommands() throws IOException, FileParsingException {
UserStats previousStats = UserStats.parseString(Storage.loadData("UserData.txt"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void testLectureSortingBackDoesNotWorkAtEnd(Logic logic) throws IOExcept
String actualText;
String expectedText;
actualText = logic.executeCommand("back").execute();
expectedText = "OOPS!!! Error occurred. Please input a valid command. Did you mean... save?";
expectedText = "OOPS!!! Error occurred. Please input a valid command. Did you mean... stats, load, start?";
Assertions.assertEquals(expectedText, actualText);
}

Expand Down

0 comments on commit ca236ec

Please sign in to comment.