public void PaymentInternalShouldCalculatedWithoutError() { //Act var exception = Record.Exception(() => FinancialCalculations.Payment(1.4, 48, 60000, 0, DueDate.EndOfPeriod)); //Assert exception.Should().BeNull(); }
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); }