Пример #1
0
        public static Parcel GetParcel(Item item)
        {
            Parcel parcel;

            if (item.IsHeavyItem)
            {
                parcel = new HeavyParcel();
            }
            else if (item.Height < 10 && item.Width < 10 && item.Depth < 10)
            {
                parcel = new SmallParcel();
            }
            else if (item.Height < 50 && item.Width < 50 && item.Depth < 50)
            {
                parcel = new MediumParcel();
            }
            else if (item.Height < 100 && item.Width < 100 && item.Depth < 100)
            {
                parcel = new LargeParcel();
            }
            else
            {
                parcel = new ExtraLargeParcel();
            }

            parcel.SetExtraWeightCost(item.Weight);

            return(parcel);
        }
Пример #2
0
 public void SetUp()
 {
     _heavyParcel = new HeavyParcel();
 }
Пример #3
0
        public void HeavyParcel_over_the_weight_limit_should_have_cost_of_50_plus_penalty(int weight, int expected)
        {
            var parcel = new HeavyParcel(weight);

            parcel.Cost.Should().Be(expected);
        }
Пример #4
0
        public void HeavyParcel_in_the_weight_limit_should_have_cost_of_50(int weight)
        {
            var parcel = new HeavyParcel(weight);

            parcel.Cost.Should().Be(50);
        }