public void CalculateTest_1() { List <decimal> cashFlows = new List <decimal>() { 10, 11, 12, 14, 16 }; CashFlowDiscountModel discModel = new CashFlowDiscountModel(); decimal result = discModel.Calculate(cashFlows, 10, 5); // 10/(1+0.1)^1 + 11/(1+0.1)^2.... = 46.69... // terminal value = 16 * 1.05 / (1.1 - 1.05) = 336 Assert.AreEqual(382.69m, Decimal.Round(result, 2)); }
/// <summary> /// /// </summary> private void SetIntrinsicSharePrice() { try { List <decimal> cashflows = new List <decimal>() { ExpectedCashflowYear1, ExpectedCashflowYear2, ExpectedCashflowYear3, ExpectedCashflowYear4, ExpectedCashflowYear5 }; IntrinsicSharePrice = _cfdm.Calculate(cashflows, DesiredRateOfReturn, TerminalGrowthRate); } catch (Exception x) { Log.Error(x); } }