Ejemplo n.º 1
0
        public void HeavyParcelTest()
        {
            var parcel       = new Parcel(22, 5, 5, 5);
            var deliveryCost = _deliveryCostCalculator.GetDeliveryCost(parcel);

            Assert.AreEqual(deliveryCost.Cost, 330);
            Assert.AreEqual(deliveryCost.Category, "Heavy Parcel");
        }
Ejemplo n.º 2
0
 public void CalculateDeliveryCost()
 {
     if (IsAllValid())
     {
         var deliveryCost = _deliveryCostCalculator.GetDeliveryCost(new Parcel(ViewModel.Weight.Value, ViewModel.Height.Value, ViewModel.Width.Value, ViewModel.Depth.Value));
         ViewModel.Cost     = (int?)deliveryCost.Cost;
         ViewModel.Category = deliveryCost.Category;
     }
 }