From 59d535f8542dc506d67e70c4ce7a0a8a173fa8d9 Mon Sep 17 00:00:00 2001 From: CYX22222003 Date: Tue, 22 Oct 2024 00:49:00 +0800 Subject: [PATCH] Update test cases for delete tag command --- .../logic/commands/DeleteTagCommandTest.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/test/java/seedu/address/logic/commands/DeleteTagCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteTagCommandTest.java index 05be9d9560c..c818a47f51c 100644 --- a/src/test/java/seedu/address/logic/commands/DeleteTagCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/DeleteTagCommandTest.java @@ -1,8 +1,10 @@ package seedu.address.logic.commands; +import static org.junit.jupiter.api.Assertions.assertFalse; import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_PERSON; +import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_PERSON; import static seedu.address.testutil.TypicalPersons.FRIEND_TAG; import static seedu.address.testutil.TypicalPersons.OWES_MONEY_TAG; import static seedu.address.testutil.TypicalPersons.getTypicalCampusConnect; @@ -44,17 +46,25 @@ public void execute_validIndexPersonList_success() { } @Test - public void execute_InvalidIndexPersonList_failure() { + public void execute_invalidIndexPersonList_throwsCommandException() { Index outOfBoundIndex = Index.fromOneBased(model.getFilteredPersonList().size() + 1); DeleteTagCommand deleteTagCommand = new DeleteTagCommand(outOfBoundIndex, new Tag(DEFAULT_TAG)); assertCommandFailure(deleteTagCommand, model, Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX); } @Test - public void execute_PersonHasNoTag_failure() { + public void execute_personHasNoTag_throwsCommandException() { Index lastIndex = Index.fromOneBased(model.getFilteredPersonList().size()); DeleteTagCommand deleteTagCommand = new DeleteTagCommand(lastIndex, new Tag(DEFAULT_TAG)); assertCommandFailure(deleteTagCommand, model, Messages.MESSAGE_NO_TAG); } + @Test + public void equals() { + DeleteTagCommand deleteTagCommandA = new DeleteTagCommand(INDEX_FIRST_PERSON, new Tag(DEFAULT_TAG)); + DeleteTagCommand deleteTagCommandB = new DeleteTagCommand(INDEX_SECOND_PERSON, new Tag(DEFAULT_TAG)); + + assertFalse(deleteTagCommandA.equals(deleteTagCommandB)); + } + }