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(); }
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)); }