From 2f443bc17797a0658e2f521ae4f80106f2460390 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Sat, 6 Apr 2024 17:51:59 +0800 Subject: [PATCH 1/4] Add bug-fixes to MenuCommand --- src/main/java/seedu/budgetbuddy/Ui.java | 25 +++++++++---------- .../budgetbuddy/command/MenuCommand.java | 2 +- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/main/java/seedu/budgetbuddy/Ui.java b/src/main/java/seedu/budgetbuddy/Ui.java index 274bfc664b..c66c0c606e 100644 --- a/src/main/java/seedu/budgetbuddy/Ui.java +++ b/src/main/java/seedu/budgetbuddy/Ui.java @@ -11,13 +11,12 @@ public void showWelcome() { "to view commands for the respective functions"); System.out.println("To view all menu items again, type \"menu\"."); System.out.println(DIVIDER); - System.out.println("1. Manage Expenses 3. View Expenses"); - System.out.println("2. Manage Savings 4. View Savings"); - System.out.println("5. Find Expenses 6. Split Expenses"); - System.out.println("7. Manage Recurring Bills"); - System.out.println("8. Change Currency 9. Manage Budget"); - System.out.println("10. Get Graphical Insights"); - + System.out.println("0. Display the whole menu"); + System.out.println("1. Manage Expenses 2. View Expenses"); + System.out.println("3. View Expenses 4. View Savings"); + System.out.println("5. Find Expenses 6. Split Expenses"); + System.out.println("7. Manage Recurring Bills 8. Change Currency"); + System.out.println("9. Manage Budget 10. Get Graphical Insights"); System.out.println(DIVIDER); } @@ -31,12 +30,12 @@ public void showGoodbye() { public void showMenuTitles() { System.out.println(DIVIDER); System.out.println("Menu Options:"); - System.out.println("1. Manage Expenses 3. View Expenses"); - System.out.println("2. Manage Savings 4. View Savings"); - System.out.println("5. Find Expenses 6. Split Expenses"); - System.out.println("7. Manage Recurring Bills "); - System.out.println("8. Change Currency 9. Manage Budget"); - System.out.println("10. Get Graphical Insights"); + System.out.println("0. Display the whole menu"); + System.out.println("1. Manage Expenses 3. View Expenses"); + System.out.println("2. Manage Savings 4. View Savings"); + System.out.println("5. Find Expenses 6. Split Expenses"); + System.out.println("7. Manage Recurring Bills 8. Change Currency"); + System.out.println("9. Manage Budget 10. Get Graphical Insights"); System.out.println("Use 'menu INDEX' to select an option"); System.out.println(DIVIDER); } diff --git a/src/main/java/seedu/budgetbuddy/command/MenuCommand.java b/src/main/java/seedu/budgetbuddy/command/MenuCommand.java index 193518615e..d5fc43272d 100644 --- a/src/main/java/seedu/budgetbuddy/command/MenuCommand.java +++ b/src/main/java/seedu/budgetbuddy/command/MenuCommand.java @@ -12,7 +12,7 @@ public class MenuCommand extends Command { private Ui ui; public MenuCommand(int index) { - assert index >= 0 : "Index should be a positive number"; + assert index > 0 : "Index should be a positive number"; this.index = index; ui = new Ui(); From 207ea650b3a9f31e38187709a5de837a17eb6795 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Sat, 6 Apr 2024 17:52:23 +0800 Subject: [PATCH 2/4] Update UG for Menu feature to accurately describe functionality --- docs/UserGuide.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 5f3df9c9e0..99795f01b5 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -45,8 +45,8 @@ Displays the corresponding features of BudgetBuddy Format: `menu [INDEX]` -* The `INDEX` refers to the number associated with each menu option. If `INDEX` is not provided, the overall -menu list will be displayed +* The `INDEX` refers to the number associated with each menu option. If `INDEX` is not provided **OR** +is of value `0`, the overall menu list will be displayed * `INDEX` must be either be empty OR a positive integer and a valid index in the menu list Example of usage: From 9dc1300ef576191a59ec20250f75792537d9ef39 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Sat, 6 Apr 2024 18:57:58 +0800 Subject: [PATCH 3/4] Refactor MenuCommand to follow correct assertion --- src/main/java/seedu/budgetbuddy/command/MenuCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/budgetbuddy/command/MenuCommand.java b/src/main/java/seedu/budgetbuddy/command/MenuCommand.java index d5fc43272d..193518615e 100644 --- a/src/main/java/seedu/budgetbuddy/command/MenuCommand.java +++ b/src/main/java/seedu/budgetbuddy/command/MenuCommand.java @@ -12,7 +12,7 @@ public class MenuCommand extends Command { private Ui ui; public MenuCommand(int index) { - assert index > 0 : "Index should be a positive number"; + assert index >= 0 : "Index should be a positive number"; this.index = index; ui = new Ui(); From cfb1aa135cbc3638f49d997275d4a5c58ecb8004 Mon Sep 17 00:00:00 2001 From: itsmejr257 Date: Sat, 6 Apr 2024 19:02:54 +0800 Subject: [PATCH 4/4] Update EXPECTED.TXT in text-ui-test to match new UI format --- text-ui-test/EXPECTED.TXT | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/text-ui-test/EXPECTED.TXT b/text-ui-test/EXPECTED.TXT index e60b2fd0b7..aaedabb82a 100644 --- a/text-ui-test/EXPECTED.TXT +++ b/text-ui-test/EXPECTED.TXT @@ -4,11 +4,11 @@ __________________________________________________ Welcome to BudgetBuddy, to start, please type "menu INDEX" to view commands for the respective functions To view all menu items again, type "menu". __________________________________________________ -1. Manage Expenses 3. View Expenses -2. Manage Savings 4. View Savings -5. Find Expenses 6. Split Expenses -7. Manage Recurring Bills -8. Change Currency 9. Manage Budget -10. Get Graphical Insights +0. Display the whole menu +1. Manage Expenses 2. View Expenses +3. View Expenses 4. View Savings +5. Find Expenses 6. Split Expenses +7. Manage Recurring Bills 8. Change Currency +9. Manage Budget 10. Get Graphical Insights __________________________________________________ Goodbye! Thank you for using BudgetBuddy.