public void CashflowsInflateMethodRaisesErrorOnCurveDimensionMismatch() { inflationRateList.RemoveAt(inflationRateList.Count - 1); Curve inflationCurve = new Curve(inflationRateList); Cashflows cashflows = new Cashflows(inputCashflowsList); cashflows.Inflate(inflationCurve, 12); }
public void CashflowsCalculatesPVOfInflatedCashflowsCorrectly() { Curve discountCurve = new Curve("../../../TestData/DiscountRate.txt"); Curve inflationCurve = new Curve("../../../TestData/InflationRate.txt"); Cashflows cashflows = new Cashflows("../../../TestData/Cashflows.txt"); Cashflows inflatedCashflows = cashflows.Inflate(inflationCurve, 12); Assert.AreEqual(920913970, inflatedCashflows.PV(discountCurve), 1); }
public void CashflowsInflatesCashflowsCorrectly() { Curve inflationCurve = new Curve(inflationRateList); Cashflows cashflows = new Cashflows(inputCashflowsList); Cashflows inflatedCashflows = cashflows.Inflate(inflationCurve, 12); double inflatedCashflowSum = 0; foreach (double inflatedCashflow in inflatedCashflows.BaseCashflows) { inflatedCashflowSum += inflatedCashflow; } Assert.AreEqual(50458603, inflatedCashflowSum, 1); }