-
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
ParserTest #375
ParserTest #375
Conversation
100% class coverage, 100% method coverage, 69% line coverage, 89% branch coverage.
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.
Overall LGTM, left some suggestions for you to consider
testImplementation 'org.mockito:mockito-core:5.3.1' | ||
testImplementation 'org.mockito:mockito-junit-jupiter:5.3.1' |
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.
I saw from this link: nus-cs2113-AY2425S1/forum#36
Mockito library is approved for use in tP!
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.
yes that is great !
@Test | ||
@DisplayName("Test exit command with appointment cleanup") | ||
void testExitCommandWithCleanup() throws IOException { | ||
// Arrange | ||
String input = "exit"; | ||
|
||
// Act | ||
boolean result = Parser.handleCommand(input, commandHandler, records, appointmentRecord); | ||
|
||
// Assert | ||
Mockito.verify(commandHandler, Mockito.times(1)).removePastAppointments(appointmentRecord); | ||
Mockito.verify(commandHandler, Mockito.times(1)).exit(input); | ||
Assertions.assertTrue(result); | ||
} |
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.
Perhaps can consider moving this class into a class called ExitCommandTest
51 tests case passed, 100% class coverage, 100% method coverage, 70% line coverage, 92% branch coverage.
Closes #374