Taghunter98 / JavaGo

0 stars 0 forks source link

Test Coffee Class #2

Open Taghunter98 opened 1 month ago

Taghunter98 commented 1 month ago

Ticket Title: Test Coffee Class Methods and Object Creation

Description: This ticket addresses the testing of the Coffee class in the JavaGo package. It ensures that all methods in the Coffee class function as expected, particularly object instantiation and printing coffee details.

Acceptance Criteria:

Test Plan:

  1. Test Environment Setup:

    • Ensure Java JDK 11+ is installed.
    • Run tests on an IDE with built-in JUnit testing (e.g., IntelliJ IDEA or Eclipse).
    • Verify the Item superclass and other dependencies are properly implemented.
  2. Test Cases:

    • Test Case ID: TC-001

      • Description: Verify the creation of a Coffee object.
      • Steps to Reproduce:
        1. Instantiate a Coffee object with the following attributes:
          Coffee("Espresso", "Strong espresso shot", 2.50, 50, false, "Oat Milk", "Arabica")
        2. Assert that the attributes are correctly set, including milk type and bean type.
      • Expected Result: The Coffee object should store the correct values for each attribute.
    • Test Case ID: TC-002

      • Description: Validate the printCoffee method with a valid item name.
      • Steps to Reproduce:
        1. Create several Coffee objects and add them to the coffees array list.
        2. Call Coffee.printCoffee("Espresso").
      • Expected Result: The details of the Espresso coffee item should be printed, including milk type and bean type.
    • Test Case ID: TC-003

      • Description: Validate the printCoffee method with an invalid item name.
      • Steps to Reproduce:
        1. Call Coffee.printCoffee("Mocha") when no Mocha coffee exists in the list.
      • Expected Result: "Coffee item not found!" should be printed to the console.
    • Test Case ID: TC-004

      • Description: Validate getMilkType() and getBeanType() methods.
      • Steps to Reproduce:
        1. Create a Coffee object and call getMilkType() and getBeanType() methods.
      • Expected Result: The correct milk type and bean type should be returned based on the object attributes.
  3. Post-conditions:

    • No data should persist between tests, and the coffees list should be empty after tests are completed.

Additional Notes: