public void CalculateXIRRShouldReturnNoValueForBadDoubleNegativeCashflows() { var service = new InterestRateCalculatorService(); var irr = service.CalculateXIRR(_badDoubleNegative, Tolerance, MaxIters); irr.Kind.Should().Be(ApproximateResultKind.NoSolutionWithinTolerance); }
public void CalculateXIRRShouldReturnNoValueForSameDayButDifferentCashflows() { var service = new InterestRateCalculatorService(); var irr = service.CalculateXIRR(_samedaydifferentcfs, Tolerance, MaxIters); irr.Kind.Should().Be(ApproximateResultKind.NoSolutionWithinTolerance); }
public void CalculateXIRRShouldReturnCorrectValueForDoubleNegativeCashflows() { var service = new InterestRateCalculatorService(); var irr = service.CalculateXIRR(_doubleNegative, Tolerance, MaxIters); irr.Value.Should().BeApproximately(-0.537055, 0.001); irr.Kind.Should().Be(ApproximateResultKind.ApproximateSolution); }
public void CalculateXIRRShouldReturnCorrectValueForBigRateCashflows() { var service = new InterestRateCalculatorService(); var irr = service.CalculateXIRR(_bigratecfs, Tolerance, MaxIters); irr.Value.Should().BeApproximately(4.40140, 0.001); irr.Kind.Should().Be(ApproximateResultKind.ApproximateSolution); }