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

[AB3: Adding Command] Test writing instructions #79

Open
ruishanteo opened this issue Aug 18, 2024 · 1 comment
Open

[AB3: Adding Command] Test writing instructions #79

ruishanteo opened this issue Aug 18, 2024 · 1 comment

Comments

@ruishanteo
Copy link

Situation

In the writing test section, there is a line:

Of course you can simply add the test cases manually, like you've been doing all along this tutorial.

However, throughout the tutorial, there was no mention of adding test cases or test files. Since the tests are added with the actual Java implementation code in the git commit links, there should be mentions of these tests in the steps.

Proposed

In the introduction of the tutorial, include:
We will also write tests to ensure that the changes are working as expected. You will find the implementation details of these tests in information boxes like this one.

In Hook RemarkCommand into the application section

  1. Since we created a new file RemarkCommand, we should also create a RemarkCommandTest file. JUnit tests are annotated with @test. For now, we expect the execute in RemarkCommand to fail. Thus, the test will reflect this expectation.
  2. Don’t forget to include a test case in AddressBookParserTest to ensure that a RemarkCommand is created when the command is parsed successfully.

In Enhancing RemarkCommand section

  1. Since RemarkCommand’s constructor now accepts arguments, the tests will reflect that. Note: you can use CommandTestUtil.java to include constant test values for greater reusability.
  2. Additionally, the equals method should be tested with various inputs, like objects of the different values or types.
  3. RemarkCommandParserTest should also be included to ensure that RemarkCommandParser works as we expect. Write test cases that cover a wide range of user inputs, such as presence of remark and fields.

In Update other usages of Person section

  1. PersonBuilder.java is used to create a default Person object for testing purposes. Don’t forget to include a remark field in this default Person too!

In Updating Storage section

  1. TypicalPersons.java is used to create various Person objects for testing. Add the remark field for these Person objects!
@damithc
Copy link
Contributor

damithc commented Aug 19, 2024

@ruishanteo you can send a PR for this, if interested.

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 a pull request may close this issue.

2 participants