12345678910111213141516171819202122232425262728293031
  1. import static org.junit.Assert.*;
  2. import org.junit.After;
  3. import org.junit.Before;
  4. import org.junit.Test;
  5. /**
  6. * The test class ProductTest.
  7. *
  8. * @author (your name)
  9. * @version (a version number or a date)
  10. */
  11. public class ProductTest
  12. {
  13. @Test
  14. public void getNameTest1()
  15. {
  16. Product product1 = new Product("bacon", 10.50, 20);
  17. assertEquals("bacon", product1.getId());
  18. }
  19. @Test
  20. public void getPriceTest1()
  21. {
  22. Product product1 = new Product("shrimp", 15.00, 50);
  23. assertEquals(15.00, product1.getPrice(), 0.01);
  24. }
  25. }