Skip to content

Commit

Permalink
Merge pull request #170 from TyrusLye/reset-documantation
Browse files Browse the repository at this point in the history
Adding documentation
  • Loading branch information
TyrusLye authored Nov 13, 2023
2 parents 75d61c6 + 55604f6 commit d18cba4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
16 changes: 13 additions & 3 deletions docs/DeveloperGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ The undo feature allows users to revert the last executed command in the address
* `AddressBookParser` — Handles the parsing of the user's undo command.
* `LogicManager` — Represents the application's data and business logic, including the functionality to undo the last command.

Given below is an example usage scenario and how the undo mechanism behaves at each step. The sequence diagram illustrates the interactions inside the Logic component for the undo command.
Given below is an example usage scenario and how the undo mechanism behaves at each step. The sequence diagram illustrates the interactions inside the Logic component for the undo command. The diagrams illustrate the flow of the execution of a successful undo command. In the diagrams below, the instance of `backupModel` is a separate instance from the current model and only serves as a container to save the data from the current model.

![Interactions Inside the Logic Component for the UndoCommand](images/UndoSequenceDiagram.png)

Expand Down Expand Up @@ -715,7 +715,7 @@ The reset feature allows users to erase the contents of the address book. This f
* `AddressBookParser` — Handles the parsing of the user's reset command.
* `LogicManager` — Represents the application's data and business logic, including the functionality to check if the user has properly gone through the appropriate steps to execute a successful address book reset.

Given below is an example usage scenario and how the reset mechanism behaves at each step. The sequence diagram illustrates the interactions inside the Logic component for the first execution of the reset command.
Given below is an example usage scenario and how the reset mechanism behaves at each step. The sequence diagram illustrates the interactions inside the Logic component for the first execution of the `reset` command. The diagrams illustrate the flow of the execution of a successful `reset` command.

Step 1. The user enters the `reset` command. And is given a warning of the functionality of the `reset` command and is prompted to enter `reset confirm` to continue executing the command.

Expand Down Expand Up @@ -1296,5 +1296,15 @@ testers are expected to do more *exploratory* testing.
Expected: Only availability statistics shown. `stats` commands will only display the first valid statistic field detected (ie. either `avail`, `current` or `housing`).
2. Viewing statistics of current fosterers and housing types work similarly, replacing `avail` with `current` and `housing` respectively.


### Resetting the Address Book
1. Resetting the Address Book
1. Prerequisites: `reset` command must be entered first, before entering `reset confirm`.
2. Test case: `reset` <br>
Expected: Warning displayed of the function of the `reset` command and a prompt of entering `reset confirm` is displayed to continue executing the command.
3. Test case: `reset confirm`
Expected: A prompt to enter `reset` first followed by `reset confirm` to execute the command.
4. Test case: `reset randomArg`
Expected: Warning displayed of the function of the `reset` command and a prompt of entering `reset confirm` is displayed to continue executing the command.
5. Test case: `reset` followed by `reset confirm`
Expected: The Address Book is erased and a command success massage is displayed.

5 changes: 1 addition & 4 deletions docs/diagrams/ResetConfirmSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ deactivate AddressBookParser
LogicManager -> ClearCommand : execute()
activate ClearCommand

ClearCommand -> Model : execute()
activate Model

Model -> Model : setAddressBook(new AddressBook())
ClearCommand -> Model : setAddressBook(new AddressBook())
activate Model

Model --> ClearCommand
Expand Down
6 changes: 2 additions & 4 deletions docs/diagrams/UndoSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,18 @@ deactivate UndoCommand
AddressBookParser --> LogicManager : u
deactivate AddressBookParser

LogicManager -> Model : execute()
LogicManager -> Model : setAddressBook(backupModel.getAddressBook())


activate Model

Model -> Model : setAddressBook(backupModel.getAddressBook())
activate Model

Model --> LogicManager
deactivate Model

deactivate UndoCommand
UndoCommand -[hidden]-> LogicManager : result
destroy UndoCommand


[<--LogicManager
deactivate LogicManager
Expand Down
Binary file modified docs/images/ResetConfirmSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/UndoSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d18cba4

Please sign in to comment.