-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update JUnit tests #117
Update JUnit tests #117
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Order(3) | ||
public void testResetBudget() throws FinancialPlannerException { | ||
BudgetCommand testBudget = new BudgetCommand(Parser.parseRawCommand("budget reset")); | ||
AddCashflowCommand testExpense = new AddCashflowCommand(Parser.parseRawCommand("add expense /a 50 /t dining")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe can add a parsertest class in the future to ensure that it is bug free
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good!
public void testDeleteBudget() throws FinancialPlannerException { | ||
BudgetCommand testBudget = new BudgetCommand(Parser.parseRawCommand("budget delete")); | ||
testBudget.execute(); | ||
assertFalse(Budget.hasBudget()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of negative testing
|
||
@Test | ||
@Order(5) | ||
public void testInvalidCommandFormat_throwsException() throws FinancialPlannerException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good unit testing involving exceptionhandling
@@ -70,4 +73,13 @@ public void testDeleteBudget() { | |||
assertEquals(0, Budget.getCurrentBudget()); | |||
assertFalse(Budget.hasBudget()); | |||
} | |||
|
|||
@Test | |||
@Order(8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ordering of test cases
No description provided.