コード例 #1
0
ファイル: TestCustomer.cs プロジェクト: gimKondo/Sushi
 public void TestTakeDish()
 {
     var customer = new Customer();
     customer.TakeDish(new Dish(PriceRank.A));
     customer.TakeDish(new Dish(PriceRank.B));
     customer.TakeDish(new Dish(PriceRank.B));
     customer.TakeDish(new Dish(PriceRank.C));
     customer.TakeDish(new Dish(PriceRank.A));
     Assert.AreEqual(5, customer.EatenDishes.Count);
 }
コード例 #2
0
ファイル: TestAccountService.cs プロジェクト: gimKondo/Sushi
 public void TestSettleUpWithTax()
 {
     var service = new AccountService(new PriceTable(), (price, rank) => (int)(price * 1.05) );
     var customer = new Customer();
     customer.TakeDish( new Dish(PriceRank.A) );
     customer.TakeDish( new Dish(PriceRank.B) );
     customer.TakeDish( new Dish(PriceRank.C) );
     customer.TakeDish( new Dish(PriceRank.C) );
     customer.TakeDish( new Dish(PriceRank.D) );
     Assert.AreEqual(1260, service.SettleUp(customer));
 }
コード例 #3
0
ファイル: TestAccountService.cs プロジェクト: gimKondo/Sushi
 public void TestSettleUpDefault()
 {
     var service = new AccountService(new PriceTable());
     var customer = new Customer();
     customer.TakeDish( new Dish(PriceRank.A) );
     customer.TakeDish( new Dish(PriceRank.B) );
     customer.TakeDish( new Dish(PriceRank.C) );
     customer.TakeDish( new Dish(PriceRank.C) );
     customer.TakeDish( new Dish(PriceRank.D) );
     Assert.AreEqual(1200, service.SettleUp(customer));
 }