Esempio n. 1
0
        public void Months_Is_Negative()
        {
            decimal value  = 100;
            var     months = -5;

            var compoundInterest = new CompoundRate(value, Rate, months);

            Assert.Throws <Exception>(() => compoundInterest.ReturnValue);
        }
Esempio n. 2
0
        public void Value_Ok()
        {
            decimal value  = 100;
            var     months = 5;

            var compoundInterest = new CompoundRate(value, Rate, months);

            Assert.Equal(105.10M, compoundInterest.ReturnValue);
        }
Esempio n. 3
0
        public void Value_Is_Zero()
        {
            decimal value  = 0;
            var     months = 5;

            var compoundInterest = new CompoundRate(value, Rate, months);

            Assert.Throws <Exception>(() => compoundInterest.ReturnValue);
        }
Esempio n. 4
0
        public void Value_Overflow()
        {
            var value  = decimal.MaxValue;
            var months = 5;

            var compoundInterest = new CompoundRate(value, Rate, months);

            Assert.Throws <OverflowException>(() => compoundInterest.ReturnValue);
        }
Esempio n. 5
0
        public decimal Get(decimal value, double rate, int months)
        {
            var compoundRate = new CompoundRate(value, rate, months);

            return(compoundRate.ReturnValue);
        }