Ejemplo n.º 1
0
        public void CalculateXIRRShouldReturnNoValueForBadDoubleNegativeCashflows()
        {
            var service = new InterestRateCalculatorService();
            var irr     = service.CalculateXIRR(_badDoubleNegative, Tolerance, MaxIters);

            irr.Kind.Should().Be(ApproximateResultKind.NoSolutionWithinTolerance);
        }
Ejemplo n.º 2
0
        public void CalculateXIRRShouldReturnNoValueForSameDayButDifferentCashflows()
        {
            var service = new InterestRateCalculatorService();
            var irr     = service.CalculateXIRR(_samedaydifferentcfs, Tolerance, MaxIters);

            irr.Kind.Should().Be(ApproximateResultKind.NoSolutionWithinTolerance);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }