Skip to content
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

Conversation

kaboomzxc
Copy link

@kaboomzxc kaboomzxc commented Nov 11, 2024

51 tests case passed, 100% class coverage, 100% method coverage, 70% line coverage, 92% branch coverage.

Closes #374

100% class coverage, 100% method coverage, 69% line coverage, 89% branch coverage.
@kaboomzxc kaboomzxc added this to the v2.1 milestone Nov 11, 2024
@kaboomzxc kaboomzxc self-assigned this Nov 11, 2024
Copy link

@yentheng0110 yentheng0110 left a 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

Comment on lines +16 to +17
testImplementation 'org.mockito:mockito-core:5.3.1'
testImplementation 'org.mockito:mockito-junit-jupiter:5.3.1'

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!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that is great !

Comment on lines +211 to +224
@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);
}

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

src/test/java/bookbob/parser/ParserTest.java Outdated Show resolved Hide resolved
@yentheng0110 yentheng0110 merged commit d28091a into AY2425S1-CS2113-T10-2:master Nov 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test Parser class
2 participants