From 70e2f66132e10cdf1206cf9715a42eef0fbebece Mon Sep 17 00:00:00 2001 From: luminousleek <68138671+luminousleek@users.noreply.github.com> Date: Tue, 12 Oct 2021 21:21:38 +0800 Subject: [PATCH 1/2] Update ClearCommand to clear ModBook instead of AddressBook --- .../java/seedu/address/logic/commands/ClearCommand.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index 9c86b1fa6e4..f4900055bd5 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -2,22 +2,22 @@ import static java.util.Objects.requireNonNull; -import seedu.address.model.AddressBook; +import seedu.address.model.ModBook; import seedu.address.model.Model; /** - * Clears the address book. + * Clears the ModBook. */ public class ClearCommand extends Command { public static final String COMMAND_WORD = "clear"; - public static final String MESSAGE_SUCCESS = "Address book has been cleared!"; + public static final String MESSAGE_SUCCESS = "ModBook has been cleared!"; @Override public CommandResult execute(Model model) { requireNonNull(model); - model.setAddressBook(new AddressBook()); + model.setModBook(new ModBook()); return new CommandResult(MESSAGE_SUCCESS); } } From 34542fcea315b5d633c7ee842c64258dbca1c444 Mon Sep 17 00:00:00 2001 From: luminousleek <68138671+luminousleek@users.noreply.github.com> Date: Tue, 12 Oct 2021 21:24:16 +0800 Subject: [PATCH 2/2] Update ClearCommandTest --- .../java/seedu/address/logic/commands/ClearCommandTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/seedu/address/logic/commands/ClearCommandTest.java b/src/test/java/seedu/address/logic/commands/ClearCommandTest.java index 1966d7bda67..95edbd0b238 100644 --- a/src/test/java/seedu/address/logic/commands/ClearCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ClearCommandTest.java @@ -6,7 +6,7 @@ import org.junit.jupiter.api.Test; -import seedu.address.model.AddressBook; +import seedu.address.model.ModBook; import seedu.address.model.Model; import seedu.address.model.ModelManager; import seedu.address.model.UserPrefs; @@ -25,7 +25,7 @@ public void execute_emptyAddressBook_success() { public void execute_nonEmptyAddressBook_success() { Model model = new ModelManager(getTypicalAddressBook(), getTypicalModBook(), new UserPrefs()); Model expectedModel = new ModelManager(getTypicalAddressBook(), getTypicalModBook(), new UserPrefs()); - expectedModel.setAddressBook(new AddressBook()); + expectedModel.setModBook(new ModBook()); assertCommandSuccess(new ClearCommand(), model, ClearCommand.MESSAGE_SUCCESS, expectedModel); }