ProductTest.java 742B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * Created by leon on 1/10/18.
  3. */
  4. import org.junit.*;
  5. import javax.swing.*;
  6. public class ProductTest {
  7. private Product televisions = new Product("Sony", 2000, 200);
  8. @Test
  9. public void setIdTest(){
  10. String expected = "Sony";
  11. String actual = televisions.getID();
  12. Assert.assertEquals(expected, actual);
  13. }
  14. @Test
  15. public void setPriceTest(){
  16. int expected = 2000;
  17. int actual = televisions.getPrice();
  18. Assert.assertEquals(expected, actual);
  19. }
  20. @Test
  21. public void setQuantityTest(){
  22. televisions.setQuantity(1000);
  23. int expected = 1000;
  24. int actual = televisions.getQuantity();
  25. Assert.assertEquals(expected, actual);
  26. }
  27. }