Skip to main content
Dat 2. semester Bornholm
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Unit testing

Test the Pizza Ordering System

Finish the implementation of the Pizza Ordering System from yesterday including the extra challenges.

Now … does the code work properly? Have you tested it?

Write tests to verify that the system works as intended:

  • the expected pizza objects are created with the Factory?
  • and decorated with expected toppings?
  • the delivery strategy works (including surcharge for express delivery)?
  • and total price is calculated as expected with/without discount coupons?

Use:

  1. Normal Java class with a main method that can test the above scenarios. OR
  2. Use JUnit5 which is a framework made specifically for test of Java methods.