InventoryTest.java 606B

123456789101112131415161718192021222324
  1. import org.junit.Assert;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class InventoryTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class InventoryTest
  12. {
  13. @Test
  14. public void getInventoryValueTest() {
  15. Product leeks = new Product("Leeks", 34, 745);
  16. Product thyme = new Product("Thyme", 11, 276);
  17. Inventory myInventory = new Inventory();
  18. myInventory.setInventory(leeks);
  19. myInventory.setInventory(thyme);
  20. Assert.assertEquals(28366, myInventory.getInventoryValue());
  21. }
  22. }