From a43b61d35f8723f4f52258a885866bd0383167da Mon Sep 17 00:00:00 2001 From: Han Bin Date: Wed, 9 Oct 2024 22:05:59 +0800 Subject: [PATCH] Fix test cases Fix test case in TagTest.java. --- .../java/seedu/address/model/tag/TagTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/java/seedu/address/model/tag/TagTest.java b/src/test/java/seedu/address/model/tag/TagTest.java index 16151b7dee8..6a7e09be0cc 100644 --- a/src/test/java/seedu/address/model/tag/TagTest.java +++ b/src/test/java/seedu/address/model/tag/TagTest.java @@ -26,30 +26,30 @@ public void isValidTagName() { assertThrows(NullPointerException.class, () -> Tag.isValidTagName(null)); } - @Test - public void canBeDeleted() { - Tag florist = FLORIST; - assertTrue(FLORIST.canBeDeleted()); - } - @Test public void noPersonsTaggedCheck() { - Tag florist = FLORIST; - assertEquals(0, FLORIST.getNumberOfPersonsTagged()); + Tag florist = new Tag(new TagName("Florist")); + assertEquals(0, florist.getNumberOfPersonsTagged()); } @Test public void incrementTaggedCount() { - Tag florist = FLORIST; + Tag florist = new Tag(new TagName("Florist")); florist.increaseTaggedCount(); assertEquals(1, florist.getNumberOfPersonsTagged()); } @Test public void decrementTaggedCount() { - Tag florist = FLORIST; + Tag florist = new Tag(new TagName("Florist"));; florist.increaseTaggedCount(); florist.decreaseTaggedCount(); assertEquals(0, florist.getNumberOfPersonsTagged()); } + + @Test + public void canBeDeleted() { + Tag florist = new Tag(new TagName("Florist")); + assertTrue(florist.canBeDeleted()); + } }