Exemple #1
0
        private static void PerformCalculation(DiscountManager dc, AccountStatus status)
        {
            decimal priceWithDiscount = 0;
            string  message           = string.Empty;

            priceWithDiscount = dc.ApplyDiscount(20000, status, 3);
            message           = $"{status.GetAttributeDescription()},  20000, 3 years, {priceWithDiscount}";
            Console.WriteLine(message);
        }
Exemple #2
0
        public void CalculateFirstTypeTest()
        {
            var price = -5;
            var type  = AccountStatus.NotRegistered;
            var timeOfHavingAccountInYears = 4;

            var result = discountManagerSUT.ApplyDiscount(price, type, timeOfHavingAccountInYears);

            Assert.Equal(price, result);
        }