Skip to content

Commit

Permalink
Merge pull request nus-cs2103-AY2122S1#75 from luminousleek/update-cl…
Browse files Browse the repository at this point in the history
…ear-command

Update clear command
  • Loading branch information
SHEZADHASSAN22 committed Oct 12, 2021
2 parents 1922ac1 + 34542fc commit a24d04e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main/java/seedu/address/logic/commands/ClearCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
Expand Down

0 comments on commit a24d04e

Please sign in to comment.