public void NumberOfPeriodsShouldCalculatedWithoutError()
        {
            //Act
            var exception = Record.Exception(() => FinancialCalculations.NumberOfPeriods(1.4, 50000, 60000, 0, DueDate.EndOfPeriod));

            //Assert
            exception.Should().BeNull();
        }
Exemple #2
0
        public void NumberOfPeriodsShouldCalculateCorrectly(double rate, double presentValue, double payment, double futureValue,
                                                            DueDate due)
        {
            //Act
            var correctSut = Financial.NPer(rate, payment, presentValue, futureValue, PaymentDue.EndOfPeriod);
            var sut        = FinancialCalculations.NumberOfPeriods(rate, payment, presentValue, futureValue, due);

            //Assert
            sut.Should().Be((short)correctSut);
        }