Example #1
0
        private void AplyDiscount(int bicycleCount)
        {
            var discount = Discounts.ApplyDiscount(bicycleCount);

            TotalPrice = TotalPrice - TotalPrice * discount.Percentage;
            Discounts  = discount;
        }
Example #2
0
        public void ApllydiscountPercetageTreeBicle()
        {
            Discounts discount = new Discounts();
            var       result   = discount.ApplyDiscount(4);

            Assert.AreEqual(0.30, result.Percentage);
            Assert.AreEqual(TypeDiscount.Family, result.TypeDiscount);
        }
Example #3
0
        public void ApllydiscountPercetageOneBicle()
        {
            Discounts discount = new Discounts();
            var       result   = discount.ApplyDiscount(1);

            Assert.AreEqual(0, result.Percentage);
            Assert.AreEqual(TypeDiscount.None, result.TypeDiscount);
        }