コード例 #1
0
 @Test
 public void testChevroletCorvettet() {
   car.ChevroletCorvettet corvettet = new car.ChevroletCorvettet("", "", "", "");
   assertEquals(
       "object corvettet created has type ChevroletCorvettet",
       corvettet.getClass(),
       ChevroletCorvettet.class);
 }
コード例 #2
0
  @Test
  public void testGetType() {

    car.ChevroletCorvettet corvettet = new car.ChevroletCorvettet("", "", "", "");
    assertEquals("corvettet is a Sports Car", corvettet.getType(), "Sports Car");

    car.FordFocus focus = new car.FordFocus("", "", "", "");
    assertFalse("Ford Focus is not a Sports Car", focus.getType().equalsIgnoreCase("Sports Car"));
  }
コード例 #3
0
 @Test
 public void testGetModel() {
   car.ChevroletCorvettet corvettet = new car.ChevroletCorvettet("", "", "", "");
   assertEquals(
       "make and model of ChevroletCorvettet is Chevrolet Corvettet ",
       corvettet.getModel(),
       "Chevrolet Corvettet");
   assertFalse(
       "make and model of ChevroletCorvettet is not Ford Focus",
       corvettet.getType().equalsIgnoreCase("Ford Focus"));
 }
コード例 #4
0
 @Test
 public void testGetValue() {
   car.ChevroletCorvettet corvettet = new car.ChevroletCorvettet("", "", "", "");
   assertTrue("ChevroletCorvettet has the price of $49,432", corvettet.getValue() == 49432);
   assertFalse("ChevroletCorvettet does not have the price of $23", corvettet.getValue() == 23);
 }