public void CalculateRateShouldCalculatedWithoutError()
        {
            //Act
            var exception = Record.Exception(() => FinancialCalculations.Rate(36, -2000, 60000, 0, DueDate.EndOfPeriod));

            //Assert
            exception.Should().BeNull();
        }
Esempio n. 2
0
        public void RateShouldCalculateCorrectly(short numberPeriods, double payment, double presentValue, double futureValue,
                                                 DueDate due)
        {
            //Act
            var correctSut = Financial.Rate(numberPeriods, -payment, presentValue, futureValue, PaymentDue.EndOfPeriod);
            var sut        = FinancialCalculations.Rate(numberPeriods, -payment, presentValue, futureValue, due);

            var isEqual = TestHelper.IsEqualDoubles(sut, correctSut);

            //Assert
            isEqual.Should().BeTrue();
        }