Skip to content

Commit

Permalink
Update Code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
Cazh1 committed Nov 12, 2023
1 parent 47c3239 commit 85dc084
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/seedu/cafectrl/storage/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void detectTamper() {
isTamperedMessagePrinted = true;
}
if (isHashStringTampered) {
ui.showToUser(Messages.HASH_STRING_TAMPERED);
ui.showToUser(Messages.HASH_STRING_TAMPERED, Messages.HASH_STRING_MESSAGE, "");
isHashStringTampered = false;
}
if (isMenuTampered) {
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/seedu/cafectrl/ui/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public class Messages {

/** Messages for view stock command */
public static final String EMPTY_STOCK = "Sorry! Pantry is currently empty!";

public static final String VIEW_STOCK_MESSAGE = "You have the following ingredients in pantry:";
public static final String VIEW_STOCK_MESSAGE2 = "| You have the following ingredients in pantry: |";
public static final String VIEW_STOCK_MESSAGE = "| You have the following ingredients in pantry: |";
public static final String VIEW_STOCK_TITLE_MESSAGE = "| Ingredients | Qty |";

/** Messages for help command */
Expand Down Expand Up @@ -100,5 +98,6 @@ public class Messages {

public static final String HASH_STRING_TAMPERED = "Alert! It appears the hash string "
+ "got a makeover without permission.";
public static final String HASH_STRING_MESSAGE = "Please resist the temptation to play Picasso with this string.";

}
2 changes: 1 addition & 1 deletion src/main/java/seedu/cafectrl/ui/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void showMenuDish(String indexNum, String dishName, String dishPrice) {
}

public void showIngredientTop() {
showToUser(Messages.MENU_END_CAP, Messages.VIEW_STOCK_MESSAGE2,
showToUser(Messages.MENU_END_CAP, Messages.VIEW_STOCK_MESSAGE,
Messages.MENU_CORNER, Messages.VIEW_STOCK_TITLE_MESSAGE, Messages.MENU_CORNER);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void execute_printPantryStock() {
System.setOut(originalOut);

String expectedOutput = Messages.MENU_END_CAP
+ Messages.VIEW_STOCK_MESSAGE2
+ Messages.VIEW_STOCK_MESSAGE
+ Messages.MENU_CORNER
+ Messages.VIEW_STOCK_TITLE_MESSAGE
+ Messages.MENU_CORNER
Expand Down

0 comments on commit 85dc084

Please sign in to comment.