diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index ff542166bd4..9d0bc95a082 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -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) @@ -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. @@ -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`
+ 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. diff --git a/docs/diagrams/ResetConfirmSequenceDiagram.puml b/docs/diagrams/ResetConfirmSequenceDiagram.puml index 8653473b1ef..f5a23c11166 100644 --- a/docs/diagrams/ResetConfirmSequenceDiagram.puml +++ b/docs/diagrams/ResetConfirmSequenceDiagram.puml @@ -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 diff --git a/docs/diagrams/UndoSequenceDiagram.puml b/docs/diagrams/UndoSequenceDiagram.puml index ad6b4f8f24b..cda8a409651 100644 --- a/docs/diagrams/UndoSequenceDiagram.puml +++ b/docs/diagrams/UndoSequenceDiagram.puml @@ -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 diff --git a/docs/images/ResetConfirmSequenceDiagram.png b/docs/images/ResetConfirmSequenceDiagram.png index 0a020214b79..710733c478f 100644 Binary files a/docs/images/ResetConfirmSequenceDiagram.png and b/docs/images/ResetConfirmSequenceDiagram.png differ diff --git a/docs/images/UndoSequenceDiagram.png b/docs/images/UndoSequenceDiagram.png index 7e4c234e470..b8191ece39c 100644 Binary files a/docs/images/UndoSequenceDiagram.png and b/docs/images/UndoSequenceDiagram.png differ