Exemple #1
0
        public virtual void test_of_constant_interface()
        {
            IsdaCreditDiscountFactors test = (IsdaCreditDiscountFactors)CreditDiscountFactors.of(USD, VALUATION, CONST_CURVE);

            assertEquals(test.Currency, USD);
            assertEquals(test.Curve, CONST_CURVE);
            assertEquals(test.DayCount, ACT_365L);
            assertEquals(test.ParameterCount, 1);
            assertEquals(test.getParameter(0), RATE_SINGLE);
            assertEquals(test.ParameterKeys, DoubleArray.of(TIME_SINGLE));
            assertEquals(test.getParameterMetadata(0), SimpleCurveParameterMetadata.of(METADATA.XValueType, TIME_SINGLE));
            assertEquals(test.ValuationDate, VALUATION);
            assertEquals(test.findData(CONST_CURVE.Name), CONST_CURVE);
            assertEquals(test.findData(CurveName.of("Rubbish")), null);
            assertEquals(test.toDiscountFactors(), ZeroRateDiscountFactors.of(USD, VALUATION, CONST_CURVE));
            assertEquals(test.IsdaCompliant, true);
        }
Exemple #2
0
        public virtual void test_of()
        {
            IsdaCreditDiscountFactors test = IsdaCreditDiscountFactors.of(USD, VALUATION, CURVE);

            assertEquals(test.Currency, USD);
            assertEquals(test.Curve, CURVE);
            assertEquals(test.DayCount, ACT_365F);
            assertEquals(test.ParameterCount, RATE.size());
            assertEquals(test.getParameter(3), RATE.get(3));
            assertEquals(test.getParameter(1), RATE.get(1));
            assertEquals(test.ParameterKeys, TIME);
            assertEquals(test.getParameterMetadata(4), SimpleCurveParameterMetadata.of(METADATA.XValueType, TIME.get(4)));
            assertEquals(test.getParameterMetadata(6), SimpleCurveParameterMetadata.of(METADATA.XValueType, TIME.get(6)));
            assertEquals(test.ValuationDate, VALUATION);
            assertEquals(test.findData(CURVE.Name), CURVE);
            assertEquals(test.findData(CurveName.of("Rubbish")), null);
            assertEquals(test.toDiscountFactors(), ZeroRateDiscountFactors.of(USD, VALUATION, CURVE));
            assertEquals(test.IsdaCompliant, true);
        }