Skip to content

Commit

Permalink
Merge pull request #240 from laney0808/upstream
Browse files Browse the repository at this point in the history
Update DG: Testing Instructions
  • Loading branch information
alex-setyawan authored Apr 15, 2024
2 parents 54b20a3 + 4b560e9 commit af8ca21
Showing 1 changed file with 89 additions and 12 deletions.
101 changes: 89 additions & 12 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ This `deleteinfo` command is facilitated by `DeleteInfoCommand` and `DeleteInfoC

* `DeleteInfoCommandParser#parse` is responsible for parsing the user input and creating a new `DeleteInfoCommand` instance.
* `DeleteInfoCommand#execute` is responsible for executing the command and removing the field of information from the patient.
* `Model#getFilteredPersonList()` is called to get the list of patients in the system.
* `Model#setField` where `Field` refers to whichever field specified to be deleted, is responsible for removing the field of information from the patient.
`DeleteInfoCommand` checks if the patient exists in the system before removing the field of information.
* `ModelManager#hasPerson(Person)` is called to check if the patient already exists in the system. It calls `ImmuniMate.hasPerson(Person)` which calls `UniquePersonList#contains(Person)` to check if the patient already exists in the internal list of patients.
Expand Down Expand Up @@ -595,34 +596,110 @@ testers are expected to do more *exploratory* testing.

1. Initial launch

1.1 Download the jar file and copy into an empty folder
1.1 Download the jar file and copy into an empty folder.

1.2 Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.
1.2 Run `java -jar immuniMate.jar` for the jar file Expected: Shows the GUI with a set of sample contacts.

2. Saving window preferences

2.1 Resize the window to an optimum size. Move the window to a different location. Close the window.
2.1 Move the window to a different location. Close the window.

2.2 Re-launch the app by double-clicking the jar file.<br>
2.2 Re-launch the app by running `java -jar ImmuniMate.jar` again.<br>
Expected: The most recent window size and location is retained.

### Adding a person

1. Adding a person while all persons are being shown.
1. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
1. Test case: `create n/Alice Tan ic/S1234567A dob/1990-01-01 hp/12345678 a/123, Jurong West Ave 6, #08-111 s/F st/PENDING`<br>
Expected: A new person is added to the list. The result panel shows the details of the new person.
1. Test case: `create n/Bob Tan ic/T0234567C dob/1990-01-01 hp/12345678 a/123, Jurong West Ave 6, #08-111 s/M st/PENDING`<br>
Expected: A new person is not added to the list. The result panel shows an error message, indicating that the person already exists in the system.
1. Test case: `create n/Charlie Tan ic/S1234567A`<br>
Expected: A new person is not added to the list. The result panel shows an error message, indicating that the command format is invalid.
2. Adding a person while only some persons are being shown
1. Prerequisites: show only 1 person's details using the `find n/alex` command. One person is shown in the list.
1. Test case: `create n/Bob Tan ic/T0234567C dob/1990-01-01 hp/12345678 a/123, Jurong West Ave 6, #08-111 s/M st/PENDING`<br>
Expected: A new person is not added to the list. The result panel shows an error message, indicating that the person already exists in the system.
### Deleting a person

1. Deleting a person while all persons are being shown

1. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
1. Prerequisites:
1. List all persons using the `list` command. Multiple persons in the list.
1. The person with NRIC `S1234567A` is already created in the system with a `create` command.

1. Test case: `delete 1`<br>
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated.
1. Test case: `delete S9234568N`<br>
Expected: First patient is deleted from the list. Details of the deleted patient shown in the status message. Timestamp in the status bar is updated.

1. Test case: `delete 0`<br>
1. Test case: `delete S9876543N`<br>
Expected: No person is deleted. Error details shown in the status message. Status bar remains the same.

1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)<br>
1. Other incorrect delete commands to try: `delete`, `delete 0`, `...` (where the input for NRIC field does not follow format for NRIC)<br>
Expected: Similar to previous.

1. _{ more test cases …​ }_

2. Deleting a person while only some persons are being shown
1. Prerequisites:
2. Show only 1 person's details using the `find n/alex` command. One person is shown in the list.
3. The person with NRIC `S1234567A` is already created in the system with a `create` command.
1. Test case: `delete S1234567A`<br>
Expected: The person is deleted from the list. The result panel shows the details of the deleted person. The list panel shows a full list of patients.

### Updating a person
1. Updating a existing person's updatable fields
1. Prerequisites:
1. The person with NRIC `S1234567A` is already created in the system with a `create` command.
1. Test case: `update S1234567A a/35 Bishan Road, #10-40 con/myopia`<br>
Expected: The person's address is updated to `35 Bishan Road, #10-40` and condition is updated to `myopia`. The result panel shows the updated person's details.
2. Test case: `update S1234567A a/35 Bishan Road, #10-40 con/`<br>
Expected: The person's both fields are not updated. The result panel shows an error message, indicating that the argument for condition is invalid.
3. Test case: `update S1234567A`<br>
Expected: The person is not updated at all. The result panel shows an error message, indicating that the command format is invalid.
2. Updating a non-existing person
1. Prerequisites:
1. The person with NRIC `S1234568A` does not exist in the system.
2. Test case: `update S1234568A a/35 Bishan Road, #10-40 con/myopia`<br>
Expected: The person is not updated at all. The result panel shows an error message, indicating that the person does not exist in the system.
3. Updating a person's non-updatable fields
1. Prerequisites:
1. The person with NRIC `S1234567A` is already created in the system with a `create` command.
1. Test case: `update S1234567A a/35 Bishan Road, #10-40 con/myopia ic/S1234568A`<br>
Expected: The person's address is updated to `35 Bishan Road, #10-40` and condition is updated to `myopia`. The NRIC is not updated.
### Finding a person

1. Finding a person by name, condition or address
1. Prerequisites:
1. The person with name `Alex Yeoh` exists in the system.
2. The person with condition `diabetes` exists in the system.
3. The person with address `123, Jurong West Ave 6, #08-111` exists in the system.
1. Test case: `find n/Alex Yeoh`<br>
Expected: The person with name `Alex Yeoh` is shown in the list. The result panel shows the details of the person.
1. Test case: `find con/diabetes`<br>
Expected: The person with condition `diabetes` is shown in the list. The result panel shows the details of the person.
1. Test case: `find a/123, Jurong West Ave 6, #08-111`<br>
Expected: The person with address `123, Jurong West Ave 6, #08-111` is shown in the list. The result panel shows the details of the person.
2. Finding a person by NRIC
1. Test case: `find n/S1234567A`<br>
Expected: The person with NRIC `S1234567A` is not shown in the list. The result panel shows an error message, indicating that the command format is invalid.

### Deleting a person's information

1. Deleting a person's optional fields
1. Prerequisites:
1. The person with NRIC `S1234567A` exists in the system.
2. The person with NRIC `S1234568A` does not exist in the system.
1. Test case: `deleteinfo S1234567A a/`<br>
Expected: The person's address becomes null. The result panel shows the updated person's details.
1. Test case: `deleteinfo S1234567A a/ con/`<br>
Expected: The person's address and condition become null. The result panel shows the updated person's details.
1. Test case: `deleteinfo S1234567A`<br>
Expected: The person's information is not deleted. The result panel shows an error message, indicating that the command format is invalid.
1. Test case: `deleteinfo S1234568A e/`<br>
Expected: The person's name is not deleted. The result panel shows an error message, indicating that the person does not exist in the system.
2. Deleting a person's mandatory fields
1. Prerequisites:
1. The person with NRIC `S1234567A` exists in the system.
1. Test case: `deleteinfo S1234567A n/`<br>
Expected: The person's name is not deleted. The result panel shows an error message, indicating that the name field cannot be deleted.
### Saving data

1. Dealing with missing/corrupted data files
Expand Down

0 comments on commit af8ca21

Please sign in to comment.