From 1f3475cb525d942c62c6f048a5c8764f3e3ed109 Mon Sep 17 00:00:00 2001 From: imanamirshah Date: Thu, 14 Mar 2024 15:24:12 +0800 Subject: [PATCH] Add JUnit test for execute method in AddCommand class --- .../seedu/binbash/command/AddCommandTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/test/java/seedu/binbash/command/AddCommandTest.java diff --git a/src/test/java/seedu/binbash/command/AddCommandTest.java b/src/test/java/seedu/binbash/command/AddCommandTest.java new file mode 100644 index 0000000000..b1c2ee5b5c --- /dev/null +++ b/src/test/java/seedu/binbash/command/AddCommandTest.java @@ -0,0 +1,18 @@ +package seedu.binbash.command; + +import org.junit.jupiter.api.Test; +import seedu.binbash.Item; +import seedu.binbash.ItemList; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class AddCommandTest { + + @Test + void execute_item_oneItemInItemList() { + ItemList itemList = new ItemList(); + + itemList.addItem("testItem", "A test item"); + assertEquals(1, itemList.getItemCount()); + } +}