예제 #1
0
 @Test
 public void OnlyCoffee() {
   Out.print("only coffee");
   CentralPerk house = new HouseBlend();
   Out.print(house.cost());
   // assertThat(actual, matcher)
   assertEquals(28.0, house.cost(), DELTA);
   CentralPerk espresso = new Espresso();
   assertEquals(32.0, espresso.cost(), DELTA);
 }
예제 #2
0
 @Test
 public void withMilk() {
   Out.print("only coffee");
   CentralPerk house = new HouseBlend();
   house = new Milk(house);
   house = new Milk(house);
   house = new Mocha(house);
   assertEquals(28 + 5 + 5 + 7, house.cost(), DELTA);
 }