Skip to content

Commit 6c5294d

Browse files
authored
Merge pull request nus-cs2103-AY2324S1#120 from jianrong7/feat/clear-command
Add clear command
2 parents b1b9327 + 791c0e0 commit 6c5294d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/main/java/seedu/address/logic/commands/ClearCommand.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@
44

55
import seedu.address.model.AddressBook;
66
import seedu.address.model.Model;
7+
import seedu.address.model.PropertyBook;
78

89
/**
910
* Clears the address book.
1011
*/
1112
public class ClearCommand extends Command {
1213

1314
public static final String COMMAND_WORD = "clear";
14-
public static final String MESSAGE_SUCCESS = "Address book has been cleared!";
15+
public static final String MESSAGE_SUCCESS = "Customer List and Property List have been cleared!";
1516

1617

1718
@Override
1819
public CommandResult execute(Model model) {
1920
requireNonNull(model);
2021
model.setAddressBook(new AddressBook());
22+
model.setPropertyBook(new PropertyBook());
2123
return new CommandResult(MESSAGE_SUCCESS);
2224
}
2325
}

src/main/resources/view/PropertyListCard.fxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<FlowPane fx:id="tags" />
3131
<Label fx:id="phone" styleClass="cell_small_label" text="\$propPhone" />
3232
<Label fx:id="address" styleClass="cell_small_label" text="\$propAddress" />
33-
<Label fx:id="budget" styleClass="cell_small_label" text="\$budget" />
33+
<Label fx:id="price" styleClass="cell_small_label" text="\$budget" />
3434
</VBox>
3535
</GridPane>
3636
</HBox>

src/test/java/seedu/address/logic/commands/ClearCommandTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import seedu.address.model.AddressBook;
1010
import seedu.address.model.Model;
1111
import seedu.address.model.ModelManager;
12+
import seedu.address.model.PropertyBook;
1213
import seedu.address.model.UserPrefs;
1314

1415
public class ClearCommandTest {
@@ -26,6 +27,7 @@ public void execute_nonEmptyAddressBook_success() {
2627
Model model = new ModelManager(getTypicalAddressBook(), getTypicalPropertyBook(), new UserPrefs());
2728
Model expectedModel = new ModelManager(getTypicalAddressBook(), getTypicalPropertyBook(), new UserPrefs());
2829
expectedModel.setAddressBook(new AddressBook());
30+
expectedModel.setPropertyBook(new PropertyBook());
2931

3032
assertCommandSuccess(new ClearCommand(), model, ClearCommand.MESSAGE_SUCCESS, expectedModel);
3133
}

0 commit comments

Comments
 (0)