コード例 #1
0
        public void PaymentInternalShouldCalculatedWithoutError()
        {
            //Act
            var exception = Record.Exception(() => FinancialCalculations.Payment(1.4, 48, 60000, 0, DueDate.EndOfPeriod));

            //Assert
            exception.Should().BeNull();
        }
コード例 #2
0
        public void PaymentShouldCalculateCorrectly(double rate, short numberPeriods, double presentValue, double futureValue,
                                                    DueDate due)
        {
            //Act
            var correctSut = Math.Abs(Financial.Pmt(rate, numberPeriods, presentValue, futureValue, PaymentDue.EndOfPeriod));
            var sut        = Math.Abs(FinancialCalculations.Payment(rate, numberPeriods, presentValue, futureValue, due));

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