Пример #1
0
        public void CashflowsInflateMethodRaisesErrorOnCurveDimensionMismatch()
        {
            inflationRateList.RemoveAt(inflationRateList.Count - 1);
            Curve     inflationCurve = new Curve(inflationRateList);
            Cashflows cashflows      = new Cashflows(inputCashflowsList);

            cashflows.Inflate(inflationCurve, 12);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }