示例#1
0
  @Test
  public void testStop() {
    // setup
    Vehicle vehicle = new Vehicle();
    vehicle.setAngle(0);
    vehicle.setOwner("hoge");
    vehicle.setSpeed(60);

    // execute
    vehicle.stop();
    double actual = vehicle.getSpeed();

    // test
    assertTrue(0.0 == actual);
  }
示例#2
0
  // ex15 test
  @Test
  public void testChangeSpeed() {
    // setup
    Vehicle vehicle = new Vehicle();
    vehicle.setAngle(0);
    vehicle.setOwner("hoge");
    vehicle.setSpeed(60);

    // execute
    vehicle.changeSpeed(12.34);
    double actual = vehicle.getSpeed();

    // test
    assertEquals(12.34, actual, 0.01);
  }