예제 #1
0
        public void ReIrrShouldCalculatedWithoutError(double[] cashFlow, double financeRate, double reInvestRate)
        {
            //Arrange
            var reIrr = new ReIrr();

            //Act
            var exception = Record.Exception(() => reIrr.ReinvestedInternalReturnRate(cashFlow, financeRate, reInvestRate));

            //Assert
            exception.Should().BeNull();
        }
예제 #2
0
        public void ReIrrShouldThrowDivideByZeroException(double[] cashFlow, double financeRate, double reInvestRate)
        {
            //Arrange
            var reIrr = new ReIrr();

            //Act
            var exception = Record.Exception(() => reIrr.ReinvestedInternalReturnRate(cashFlow, financeRate, reInvestRate));

            //Assert
            exception.Should().NotBeNull();
            exception.GetType().Should().Be(typeof(DivideByZeroException));
        }