Ejemplo n.º 1
0
        public void CashflowsCalculatesPVCorrectly()
        {
            Curve     discountCurve = new Curve(discountRateList);
            Cashflows cashflows     = new Cashflows(inputCashflowsList);

            Assert.AreEqual(46004733, cashflows.PV(discountCurve), 1);
        }
Ejemplo n.º 2
0
        public void CashflowsPVMethodRaisesErrorOnCurveDimensionMismatch()
        {
            discountRateList.RemoveAt(discountRateList.Count - 1);
            Curve     discountCurve = new Curve(discountRateList);
            Cashflows cashflows     = new Cashflows(inputCashflowsList);

            cashflows.PV(discountCurve);
        }
Ejemplo n.º 3
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);
        }