Skip to content

Commit

Permalink
Merge pull request #93 from hsiaojietng/add-favourite-window-feature
Browse files Browse the repository at this point in the history
Fix accidental deletion of buyer/seller labels and exit command's beh…
  • Loading branch information
hsiaojietng authored Mar 22, 2022
2 parents 4a5e59a + f00c287 commit 0d04112
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ExitCommand extends Command {

@Override
public CommandResult execute(Model model) {
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, false, true, false);
return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, false, false, true);
}

}
3 changes: 2 additions & 1 deletion src/main/resources/view/PersonListCard.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<Label fx:id="name" styleClass="cell_big_label" text="\$first" />
</HBox>
<VBox>
<FlowPane fx:id="userType" />
<Label fx:id="seller"/>
<Label fx:id="buyer"/>
<Label fx:id="phone" styleClass="cell_small_label" text="\$phone" />
<Label fx:id="address" styleClass="cell_small_label" text="\$address" />
<Label fx:id="email" styleClass="cell_small_label" text="\$email" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ public void equals() {
assertFalse(commandResult.equals(new CommandResult("feedback", true, false, false, false)));

// different showFavourites value -> returns false
assertFalse(commandResult.equals(new CommandResult("feedback", true, false, true, false)));
assertFalse(commandResult.equals(new CommandResult("feedback", false, false, true, false)));

// different exit value -> returns false
assertFalse(commandResult.equals(new CommandResult("feedback", false, false, true, false)));
assertFalse(commandResult.equals(new CommandResult("feedback", false, false, false, true)));
}

@Test
Expand All @@ -55,6 +55,6 @@ public void hashcode() {
assertNotEquals(commandResult.hashCode(), new CommandResult("feedback", false, false, true, false).hashCode());

// different exit value -> returns different hashcode
assertNotEquals(commandResult.hashCode(), new CommandResult("feedback", false, false, true, false).hashCode());
assertNotEquals(commandResult.hashCode(), new CommandResult("feedback", false, false, false, true).hashCode());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ExitCommandTest {
@Test
public void execute_exit_success() {
CommandResult expectedCommandResult = new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT,
false, false, true, false);
false, false, false, true);
assertCommandSuccess(new ExitCommand(), model, expectedCommandResult, expectedModel);
}
}

0 comments on commit 0d04112

Please sign in to comment.