import static org.junit.Assert.*; import org.junit.After; import org.junit.Before; import org.junit.Test; /** * The test class ProductTest. * * @author (your name) * @version (a version number or a date) */ public class ProductTest { private GeneralStore generalS1; private Product product1; /** * Default constructor for test class ProductTest */ public ProductTest() { } /** * Sets up the test fixture. * * Called before every test case method. */ @Before public void setUp() { generalS1 = new GeneralStore(); product1 = new Product("Apple", 5, TaxCategory.EXTREME_TAX); } /** * Tears down the test fixture. * * Called after every test case method. */ @After public void tearDown() { } @Test public void MyFirstTest() { Product product1 = new Product("Apple", 5, TaxCategory.LOW_TAX); assertEquals("Apple", product1.getName()); } @Test public void TaxCalculation() { assertEquals(10, product1.getPriceWithTax(), 0.1); } }