12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
-
-
- import static org.junit.Assert.*;
- import org.junit.After;
- import org.junit.Before;
- import org.junit.Test;
-
- /**
- * The test class TicketMachineTest.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class TicketMachineTest
- {
- private TicketMachine ticketMa1;
- private TicketMachine ticketMa2;
- private TicketMachine ticketMa3;
- private TicketMachine ticketMa4;
-
- /**
- * Default constructor for test class TicketMachineTest
- */
- public TicketMachineTest()
- {
- }
-
- /**
- * Sets up the test fixture.
- *
- * Called before every test case method.
- */
- @Before
- public void setUp()
- {
- ticketMa1 = new TicketMachine(500);
- ticketMa2 = new TicketMachine(100);
- ticketMa2.showPrice();
- ticketMa1.showPrice();
- ticketMa3 = new TicketMachine(500);
- ticketMa4 = new TicketMachine(100);
- ticketMa4.showPrice();
- ticketMa3.showPrice();
- ticketMa4.setPrice(50);
- ticketMa3.setPrice(100);
- ticketMa4.showPrice();
- ticketMa3.setPrice(100);
- ticketMa3.showPrice();
- ticketMa4.showPrice();
- ticketMa3.printTicket();
- ticketMa4.getPrice();
- ticketMa3.getPrice();
- ticketMa4.getPrompt();
-
- }
-
- /**
- * Tears down the test fixture.
- *
- * Called after every test case method.
- */
- @After
- public void tearDown()
- {
- }
- }
|