Skip to content

Commit

Permalink
Improve coding standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaychiMin committed Nov 9, 2023
1 parent ea05f47 commit e263e79
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ Format: `list_sale day/DAY_TO_DISPLAY`
Example: `list_sale day/2`

Output:
- list_sale day/2 lists the dishes sold along with the total sales for day 1.
- list_sale day/2 lists the dishes sold along with the total sales for day 2.
```
+---------------------------------------------------------------------------+
| Day 2: |
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/cafectrl/data/OrderList.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void printOrderList(Menu menu, Ui ui) {
}

for (Order aggregatedOrder : aggregatedOrders) {
if (aggregatedOrder.getQuantity()==0) {
if (aggregatedOrder.getQuantity() == 0) {
continue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void execute_addInvalidOrder_expectRestockMessage() {

String expectedOutput = Messages.CHEF_MESSAGE
+ Messages.RESTOCK_CORNER
+ "| Restock | Current | Needed |"
+ Messages.RESTOCK_TITLE
+ Messages.RESTOCK_CORNER
+ "| chicken | 1000g | 2000g |"
+ Messages.RESTOCK_END_CAP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import seedu.cafectrl.data.Menu;
import seedu.cafectrl.data.dish.Dish;
import seedu.cafectrl.data.dish.Ingredient;
import seedu.cafectrl.ui.Messages;
import seedu.cafectrl.ui.Ui;

import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -40,14 +41,14 @@ public void execute_validIndex_printsIngredients() {
String actualOutput = baos.toString().trim();
System.setOut(originalOut);

String expectedOutput = "+-------------------------------------------------------+"
String expectedOutput = Messages.INGREDIENTS_END_CAP
+ "| Dish: chicken rice |"
+ "+----------------------------------------+--------------+"
+ "| Ingredient + Quantity +"
+ "+----------------------------------------+--------------+"
+ Messages.INGREDIENTS_CORNER
+ Messages.INGREDIENTS_TITLE
+ Messages.INGREDIENTS_CORNER
+ "| rice | 100g |"
+ "| chicken | 200g |"
+ "+-------------------------------------------------------+";
+ Messages.INGREDIENTS_END_CAP;

String normalizedExpected = expectedOutput.toLowerCase().replaceAll("\\s+", "").trim();
String normalizedActual = actualOutput.toLowerCase().replaceAll("\\s+", "").trim();
Expand Down

0 comments on commit e263e79

Please sign in to comment.