public void Months_Is_Negative() { decimal value = 100; var months = -5; var compoundInterest = new CompoundRate(value, Rate, months); Assert.Throws <Exception>(() => compoundInterest.ReturnValue); }
public void Value_Ok() { decimal value = 100; var months = 5; var compoundInterest = new CompoundRate(value, Rate, months); Assert.Equal(105.10M, compoundInterest.ReturnValue); }
public void Value_Is_Zero() { decimal value = 0; var months = 5; var compoundInterest = new CompoundRate(value, Rate, months); Assert.Throws <Exception>(() => compoundInterest.ReturnValue); }
public void Value_Overflow() { var value = decimal.MaxValue; var months = 5; var compoundInterest = new CompoundRate(value, Rate, months); Assert.Throws <OverflowException>(() => compoundInterest.ReturnValue); }
public decimal Get(decimal value, double rate, int months) { var compoundRate = new CompoundRate(value, rate, months); return(compoundRate.ReturnValue); }