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

Add developer test cases in DG #197

Merged
merged 3 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 99 additions & 26 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ Step 4. The filtered list and success message will be reflected in the UI.

The following sequence diagram shows how the `list contact` command works:

![list-contact-sequence-diagram](diagrams/ListContactSequenceDiagram.png)
<puml src="diagrams/tag/ListContactSequenceDiagram.puml"/>

The following activity diagram shows how the `list contact` command works:

![list-contact-activity-diagram](diagrams/ListContactActivityDiagram.png)
<puml src="diagrams/tag/ListContactActivityDiagram.puml"/>

### Tag feature
This feature allows users to add and remove `Tag` to any `Person` in the contact list. It provides an easy way for users to catrgorize their contacts.
Expand Down Expand Up @@ -885,42 +885,115 @@ testers are expected to do more *exploratory* testing.

### Deleting a person

1. Deleting a person while all persons are being shown
1. Deleting a contact while all contacts are being shown

1. Prerequisites: List all persons using the `list` command. Multiple persons in the list.
1. Prerequisites: List all contacts using the `list contact` command. Multiple contacts will be shown in the list.

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

3. Test case: `delete 0`<br>
Expected: No person is deleted. Error details shown in the status message.
1. Test case: `delete contact 0`<br>
Expected: No contact is deleted. Error details shown in the status message.

4. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)<br>
1. Other incorrect delete contact commands to try: `delete contact`, `delete contact x`, `...` (where x is larger than the list size)<br>
Expected: Similar to previous.

2. Deleting a contact while event list is showing

2. Deleting a person while event list is showing

1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. Add events to the first person in the index and remove all event from the second person in the index.
1. Prerequisites: List all contacts using the `list` command. Multiple contacts in the list. Add events to the first contact in the index and remove all event from the second contact in the index.

2. Test case: `delete 1`<br>
2. Test case: `delete contact 1`<br>
Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. All events related to the first contact should be deleted from the event list as well

### Adding event

1. Adding event while all contacts are shown.
1. Prequisites: List all contacts using the `list contact` command. At least one contact shown in the list and there will be an events column for each contact.
Use the `list events` command to open a new window with a list of all events without the respective contacts.<br>

1. Test case: `add event -id 1 -en Meeting with professor -st 2024-11-17 12:00:00 -et 2024-11-17 13:00:00 -loc COM 1 Basement -info Discuss the project`<br>
Expected: The new event will appear in the first contact's event column. It will also be added in the event list window. The title of the event added is shown in the status message.

1. Test case: `add event -id 1 -en Meeting with professor -st 12:00:00 -et 13:00:00 -loc COM 1 Basement -info Discuss the project`<br>
Expected: Similar to previous test, but date will automatically be current date.<br>

1. Test case: `add event -id 1 -en Meeting with professor -st 2024-11-17 -et 2024-11-18 -loc COM 1 Basement -info Discuss the project`<br>
Expected: Similar to previous test, but time will automatically be `00:00:00`.<br>

1. Test case: `add event -id 0 -en Chat with recruiter -st 2024-11-24 17:00:00 -et 2024-11-24 18:00:00 -loc Star Vista -info Discuss job opportunities`<br>
Expected: No event is added. Error details shown in the status message.

1. Test case: `add event -id 1 -en Chat with recruiter -st 2024/11/24 17:00:00 -et 2024/11/24 18:00:00 -loc Star Vista -info Discuss job opportunities`<br>
Expected: No event is added as date and time is not in the correct format. Error details shown in the status message.<br>

1. Adding duplicate or clashing events
1. Prequisites: Use the `list events` command to open a new window with a list of all events without the respective contacts.

1. Test case: `add event -id 1 ...`, where `...` is an already existing event in the event list.<br>
Expected: No event is added. Error details shown in the status message.

1. Test case: `add event -id 1 ... -st x` where `x` is in between the start and end time of an event currently on the list.<br>
Expected: No event is added. Error details shown in the status message.

1. Adding event while contact list is being filtered
1. Prerequisites: Filter the list of contacts either by calling `list contact -t [SOME_TAG]` or `find [SOME KEYWORD]`.
Use the `list events` command to open a new window with a list of all events without the respective contacts.

1. Test case: `add event -id 1 ...`, when no contact is shown<br>
Expected: No event is added. Error details shown in the status message.

1. Test case: `add event -id 1 ...`, when at least 1 contact is shown<br>
Expected: The new event will appear in the first contact's (in the filtered list) event column. It will also be added in the event list window. The title of the event added is shown in the status message.

### Deleting event

1. Deleting an event while all events are being shown

1. Prerequisites: List all contacts and events using the `list contact` command. This will show every contact and its respective events.
Use the `list events` command to open a new events window showing all events (without the contacts).

1. Test case: `delete event -id 2 -eid 1`<br>
Expected: First event of the second contact is deleted. Title of the deleted event shown in the status message.
Event deleted from the list in the events window.

1. Test case: `delete event -id 0 -eid 1`<br>
Expected: No event is deleted. Error details (contact not found) shown in the status message.

1. Test case: `delete event -id 1 -eid 0`<br>
Expected: No event is deleted. Error details (event not found) shown in the status message.

1. Other incorrect delete commands to try: `delete event`, `delete event -id x -eid 1`, `delete event -id 1 -eid x`, `...` (where x is larger than the size of contacts/events)<br>
Expected: Similar to previous test cases.

1. Deleting event while contact list is being filtered
1. Prerequisites: Filter the list of contacts either by calling `list contact -t [SOME_TAG]` or `find [SOME KEYWORD]`.
Use the `list events` command to open a new events window showing all events (without the contacts).

1. Test case: `delete event -id 1 -eid 1`, when no contact is shown<br>
Expected: No event is deleted. Error details shown in the status message.

1. Test case: `delete event -id 1 -eid 1`, when at least 1 contact is shown and there is at least 1 event in the first contact. <br>
Expected: The event will no longer be shown in the first contact of the filtered list. It will also be removed from the events list window. List will go back to showing all contacts.

1. Test case: `delete event -id 1 -eid 1`, when at least 1 contact is shown and there are no events in the first contact. <br>
Expected: No event is deleted. Error details shown in the status message.

### Adding tag

1. Adding tag while all contacts is shown.
1. Prequisites: List all contacts using the list command. At least one contact shown in the list.<br>
1. Prequisites: List all contacts using the `list contact` command. At least one contact shown in the list.<br>

1. Test case: `add tag -id 1 -t Frontend -t Java`<br>
Expected: The new tags appear below the name of the first contact in the list. The list of tags added is shown in the status message.

1. Test case: `add tag -id 0 -t Frontend`<br>
Expected: No tag add is added. Error details shown in the status message.
Expected: No tag is added. Error details shown in the status message.

1. Test case: `add tag -id 1 -t HR representative`<br>
Expected: No tag is added as tag name should not contain spaces. Error details shown in the status message.<br>

1. Adding duplicate tag to a contact
1. Prequisites: List all contacts using the list command. At least one contact shown in the list has at least one tag.
1. Prequisites: List all contacts using the `list contact` command. At least one contact shown in the list has at least one tag.

1. Test case: `add tag -id 1 -t x`, where x is an already existing tag in the first contact.<br>
Expected: The new tag appear below the name of the first contact in the list. The list of tags added is shown in the status message.
Expand All @@ -932,7 +1005,7 @@ testers are expected to do more *exploratory* testing.
1. Prerequisites: Filter the list of contacts either by calling `list contact -t [SOME_TAG]` or `find [SOME KEYWORD]`.

1. Test case: `add tag -id 1 -t Frontend`, when no contact is shown<br>
Expected: No tag add is added. Error details shown in the status message.
Expected: No tag is added. Error details shown in the status message.

1. Test case: `add tag -id 1 -t Frontend`, when at least 1 contact is shown<br>
Expected: The new tags appear below the name of the first contact in the filtered list. The list of tags added is shown in the status message. List will go back to showing all contacts.
Expand All @@ -941,19 +1014,19 @@ testers are expected to do more *exploratory* testing.
### Deleting tag

1. Deleting tag while all contacts is shown and tag exists.
1. Prequisites: List all contacts using the list command. At least one contact shown in the list has at least one tag.
1. Prequisites: List all contacts using the `list contact` command. At least one contact shown in the list has at least one tag.

1. Test case: `delete tag -id 1 -t x`, where x is an existing tag in the first contact.<br>
Expected: The tag x is no longer below the name of the first contact in the list. The list of tags deleted is shown in the status message.

1. Test case: `delete tag -id 0 -t Frontend`<br>
Expected: No tag add is deleted. Error details shown in the status message.
Expected: No tag is deleted. Error details shown in the status message.

1. Test case: `delete tag -id 1 -t HR representative`<br>
Expected: No tag deleted as tag name should not contain spaces. Error details shown in the status message.<br>

1. Deleting tag while all contacts is shown but tag does not exist.
1. Prequisites: List all contacts using the list command. At least one contact is shown in the list.<br>
1. Prequisites: List all contacts using the `list contact` command. At least one contact is shown in the list.<br>

1. Test case: `delete tag -id 1 -t x`, where `x` is a non-existing tag in the first contact.<br>
Expected: No tags is deleted. The list of tags deleted shown in the status message is empty while the list of tags not found contains `x`.
Expand All @@ -962,18 +1035,18 @@ testers are expected to do more *exploratory* testing.
1. Prerequisites: Filter the list of contacts either by calling `list contact -t [SOME_TAG]` or `find [SOME KEYWORD]`.

1. Test case: `delete tag -id 1 -t Frontend`, when no contact is shown<br>
Expected: No tag add is deleted. Error details shown in the status message.
Expected: No tag is deleted. Error details shown in the status message.

1. Test case: `add tag -id 1 -t x`, when at least 1 contact is shown and `x` is an existing tag in the first contact. <br>
1. Test case: `delete tag -id 1 -t x`, when at least 1 contact is shown and `x` is an existing tag in the first contact. <br>
Expected: The tag `x` is no longer below the name of the first contact in the list. The list of tags deleted shown in the status message is empty while the list of tags not found contains `x`. List will go back to showing all contacts.

1. Test case: `add tag -id 1 -t x`, when at least 1 contact is shown and `x` is a non-existing tag in the first contact. <br>
1. Test case: `delete tag -id 1 -t x`, when at least 1 contact is shown and `x` is a non-existing tag in the first contact. <br>
Expected: The tag `x` is no longer below the name of the first contact in the list. The list of tags deleted is shown in the status message. List will go back to showing all contacts.

### Adding note

1. Adding note while all contacts is shown.
1. Prerequisites: List all contacts using the list command. At least one contact shown in the list.<br>
1. Prerequisites: List all contacts using the `list contact` command. At least one contact shown in the list.<br>

2. Test case: `add note -id 1 -tit Meeting Topics -con The topic is about the framework design of the project`<br>
Expected: The new note appears in the Notes column of the contact. The note added is shown in the status message.
Expand All @@ -985,7 +1058,7 @@ testers are expected to do more *exploratory* testing.
Expected: No note is added as a note should have a note content. Error details shown in the status message.<br>

2. Adding another note to a contact
1. Prerequisites: List all contacts using the list command. At least one contact shown in the list has at least one note.
1. Prerequisites: List all contacts using the `list contact` command. At least one contact shown in the list has at least one note.

2. Test case: `add note -id 1 -tit Open Position -con Applications for SWE full-time positions will open soon`, where x is an already existing tag in the first contact.<br>
Expected: The new note appears in the Notes column of the contact. The note added is shown in the status message.
Expand All @@ -1002,7 +1075,7 @@ testers are expected to do more *exploratory* testing.
### Deleting note

1. Deleting note while all contacts is shown and note exists.
1. Prerequisites: List all contacts using the list command. At least one contact shown in the list has at least one note.
1. Prerequisites: List all contacts using the `list contact` command. At least one contact shown in the list has at least one note.

2. Test case: `delete note -id 1 -nid 0`<br>
Expected: No note is deleted as note id is invalid. Error details shown in the status message.
Expand All @@ -1011,7 +1084,7 @@ testers are expected to do more *exploratory* testing.
Expected: The note deleted is no longer shown in the first contact in the list. The note deleted is shown in the status message.

2. Deleting note while all contacts is shown but note does not exist.
1. Prerequisites: List all contacts using the list command. At least one contact is shown in the list.<br>
1. Prerequisites: List all contacts using the `list contact` command. At least one contact is shown in the list.<br>

2. Test case: `delete note -id 1 -nid 100`, where the number of notes in the first contact is less than 100.<br>
Expected: No note is deleted. Error details shown in the status message.
Expand Down
Binary file removed docs/diagrams/ListContactActivityDiagram.png
Binary file not shown.
Binary file removed docs/diagrams/ListContactSequenceDiagram.png
Binary file not shown.
Loading