Ejemplo n.º 1
0
 /** testing for method passengerClearedCustoms */
 @Test
 public void testPassengerClearedCustoms() {
   Simulator s = new Simulator(numCustomsDesks, numPassengers);
   assertFalse(s.passengerClearedCustoms());
   s.step();
   assertFalse(s.passengerClearedCustoms());
   s.step();
   assertTrue(s.passengerClearedCustoms());
 }
Ejemplo n.º 2
0
 /** testing for method moreSteps */
 @Test
 public void testMoreSteps() {
   Simulator s = new Simulator(numCustomsDesks, numPassengers);
   assertTrue(s.moreSteps());
   s.step();
   assertTrue(s.moreSteps());
   s.step();
   assertFalse(s.moreSteps());
 }
Ejemplo n.º 3
0
  /** testing for method getCurrentIndex */
  @Test
  public void testGetCurrentIndex() {
    Simulator s = new Simulator(numCustomsDesks, numPassengers);
    assertEquals(-1, s.getCurrentIndex());

    s.step();

    int a = s.getCurrentIndex();
    assertTrue(a < 3 && a >= 0);

    s.step();
    a = s.getCurrentIndex();
    assertTrue(a >= 0);
  }
Ejemplo n.º 4
0
 /** testing for method getStepsTaken */
 @Test
 public void testGetStepsTaken() {
   Simulator s = new Simulator(numCustomsDesks, numPassengers);
   assertEquals(0, s.getStepsTaken());
   s.step();
   assertEquals(1, s.getStepsTaken());
 }