Ticket Title: Test Item Class Functionality and Methods
Description:
This ticket focuses on testing the Item class within the JavaGo package. The goal is to ensure that all core methods work as expected, including object creation, item detail printing, and array handling.
Ticket Title: Test
Item
Class Functionality and MethodsDescription: This ticket focuses on testing the
Item
class within theJavaGo
package. The goal is to ensure that all core methods work as expected, including object creation, item detail printing, and array handling.Related Issue: #Item-Class-Implementation (link to the corresponding development issue)
Acceptance Criteria:
Item
object should be created with correct attributes (name, description, price, calories, allergen status).printItem
andprintItems
methods should function correctly, displaying the required information.getItemName()
,getItemDes()
,getPrice()
, andgetItemCal()
should return the correct values.items
array.Test Plan:
Test Environment Setup:
Terminal
class are functional.Test Cases:
Test Case ID: TC-001
Item
object.Item
object using the following attributes:Item("Americano", "Strong black coffee", 2.50, 5, false)
Item
object should store the correct values for all attributes.Test Case ID: TC-002
printItem
method with a valid item name.Item
objects and add them to theitems
array list.Item.printItem("Americano")
.Americano
item should be printed, including the name, description, calories, and allergen info.Test Case ID: TC-003
printItem
method with an invalid item name.Item.printItem("Mocha")
when noMocha
item exists in the list.Test Case ID: TC-004
printItems
method.Item
objects and add them to theitems
list.Item.printItems()
.items
array list should be printed with details like name, description, price, and calories.Test Case ID: TC-005
Item
object.getItemName()
,getItemDes()
,getPrice()
,getItemCal()
,hasAllergy()
.Post-conditions:
items
list should be cleared after test completion.Additional Notes:
Terminal
class, are available and functional.