forked from nus-cs2113-AY2324S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from imanamirshah/JUnitTest-Add
Add JUnit test for addItem
- Loading branch information
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package seedu.binbash.command; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import seedu.binbash.ItemList; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class AddCommandTest { | ||
|
||
@Test | ||
void execute_item_oneItemInItemList() { | ||
ItemList itemList = new ItemList(); | ||
AddCommand addCommand = new AddCommand(itemList, "testItem", "A test item"); | ||
|
||
addCommand.execute(); | ||
assertEquals(1, itemList.getItemCount()); | ||
} | ||
} |