Пример #1
0
 public void TestDefaultConstruct()
 {
     var table = new PriceTable();
     Assert.AreEqual(400, table.Price(PriceRank.A));
     Assert.AreEqual(300, table.Price(PriceRank.B));
     Assert.AreEqual(200, table.Price(PriceRank.C));
     Assert.AreEqual(100, table.Price(PriceRank.D));
 }
Пример #2
0
 /// <summary>
 /// construct with additional price
 /// </summary>
 /// <param name="table"></param>
 /// <param name="additionalPrice">tax, discount or bla bla bla</param>
 public AccountService(PriceTable table, Func<int,PriceRank,int> additionalPrice)
 {
     Table = table;
     AdditionalPrice = additionalPrice;
 }
Пример #3
0
 /// <summary>
 /// construct without additional price
 /// </summary>
 /// <param name="table"></param>
 public AccountService(PriceTable table)
 {
     Table = table;
     AdditionalPrice = (price, rank) => price;
 }