Skip to content

Commit

Permalink
Add in blank lines that have been deleted by IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
tsulim committed Apr 15, 2024
1 parent b03724d commit 2174a29
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,11 @@ The sort mechanism is facilitated by JavaFX's `SortedList` within ModelManager,
Given below is an example usage scenario and how the sort mechanism behaves at each step.

1. The user enters **“sort n/”** to sort the list by their name.

2. The `LogicManager` takes this command text and calls `StaffBookParser.parseCommand("sort n/")` and identifies the sort command. It then creates a new instance of `SortCommandParser` to `parse(“n/”)` on the attribute.

3. `SortCommandParser.parse(“n/”)` then constructs a SortCommand with the appropriate attribute comparator, `NameComparator`.

4. The `SortCommand` is returned to Logic manager which calls on its `execute()` to return a `CommandResult()`. During its execution, `ModelManager.updateSortedPersonList(NameComparator)` is invoked which updates the model to show the list of persons being sorted by name.

The sequence diagram for executing a **"sort n/"** is shown below:
Expand Down Expand Up @@ -391,8 +394,8 @@ The below sequence diagram goes into more details on how the execution of the co

![Fav Ref Sequence Diagram](images/FavRefSequenceDiagram.png)

1. `FavCommand` calls the static `FavCommand#createFavPerson(personToFav)` function which calls for the static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` using the `selectedPerson` and a new `Favourite` with the value `true`.
2. This static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` function creates a new `Person` with the given `Favourite` and returns back to `FavCommand`.
7. `FavCommand` calls the static `FavCommand#createFavPerson(personToFav)` function which calls for the static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` using the `selectedPerson` and a new `Favourite` with the value `true`.
8. This static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` function creates a new `Person` with the given `Favourite` and returns back to `FavCommand`.

The following activity diagram summarizes what happens when a user executes a new `fav` command:

Expand All @@ -419,8 +422,8 @@ The below sequence diagram goes into more details on how the execution of the co

![Unfav Ref Sequence Diagram](images/UnfavRefSequenceDiagram.png)

1. `UnfavCommand` calls the static `UnfavCommand#createUnfavPerson(personToUnfav)` function which calls for the static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` using the `selectedPerson` and a new `Favourite` with the value `false`.
2. This static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` function creates a new `Person` with the given `Favourite` attribute and returns back to `UnfavCommand`.
7. `UnfavCommand` calls the static `UnfavCommand#createUnfavPerson(personToUnfav)` function which calls for the static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` using the `selectedPerson` and a new `Favourite` with the value `false`.
8. This static `PersonUtil#createPersonWithFavouriteStatus(Person selectedPerson, Favourite favourite)` function creates a new `Person` with the given `Favourite` attribute and returns back to `UnfavCommand`.

The following activity diagram summarizes what happens when a user executes a new `unfav` command:

Expand Down Expand Up @@ -705,10 +708,13 @@ testers are expected to do more *exploratory* testing.
1. Initial launch

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

2. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum.

2. Saving window preferences

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

2. Re-launch the app by double-clicking the jar file.<br>
Expected: The most recent window size and location is retained.

Expand All @@ -717,10 +723,13 @@ testers are expected to do more *exploratory* testing.
1. Deleting a person while all persons are being shown

1. Prerequisites: List all persons using the `list` command. Multiple persons in the list.

2. 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.

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

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

Expand All @@ -729,18 +738,21 @@ testers are expected to do more *exploratory* testing.
1. Dealing with missing/corrupted data files

1. Prerequisites: Ensure that the `[JAR file location]/data/staffconnect.json` file is generated by running the JAR file of the app at least once.

2. Test case: No modifications to data file after it has been generated.<br>
In the image below shows the contents of the untouched data file:
![Before Corrupt Data File](images/beforeCorruptDataFile.png)

Expected: The app should show a list of 6 persons
![Before Corrupt Data File Result](images/beforeCorruptDataFileResult.png)

3. Test case: Invalid modification to data file.<br>
Modify the `Favourite` attribute value to `Not avourite` (an invalid value) in the data file:
![After Corrupt Data File](images/afterCorruptDataFile.png)

Expected: The app should show an empty list (no persons)
![After Corrupt Data File Result](images/afterCorruptDataFileResult.png)

4. Test case: Valid modification to data file.<br>
Before, `Alex Yeoh` has the module `CS1101S` in the untouched data file as seen in `Test case: No modifications to data file after it has been generated`.

Expand Down

0 comments on commit 2174a29

Please sign in to comment.