コード例 #1
0
ファイル: Order.cs プロジェクト: efarr/Simple-CS-BDD
 public void ApplyDiscount(DatedDiscount datedDiscount)
 {
     if (datedDiscount.IsValidOn(OrderDate))
         foreach (OrderedProduct orderedProduct in Products)
         {
             orderedProduct.ApplyDiscount(datedDiscount);
         }
 }
コード例 #2
0
ファイル: OrderedProduct.cs プロジェクト: efarr/Simple-CS-BDD
 internal void ApplyDiscount(DatedDiscount datedDiscount)
 {
     if (datedDiscount.DoesApplyTo(_product))
         _appliedDiscount = new AppliedDiscount(datedDiscount.DiscountPercent, _appliedDiscount);
 }