예제 #1
0
        //-------------------------------------------------------------------------
        public virtual void test_of_noSeasonality()
        {
            SimplePriceIndexValues test = SimplePriceIndexValues.of(US_CPI_U, VAL_DATE, CURVE_NOFIX, USCPI_TS);

            assertEquals(test.Index, US_CPI_U);
            assertEquals(test.ValuationDate, VAL_DATE);
            assertEquals(test.Curve, CURVE_NOFIX);
            assertEquals(test.ParameterCount, CURVE_NOFIX.ParameterCount);
            assertEquals(test.getParameter(0), CURVE_NOFIX.getParameter(0));
            assertEquals(test.getParameterMetadata(0), CURVE_NOFIX.getParameterMetadata(0));
            assertEquals(test.withParameter(0, 1d).Curve, CURVE_NOFIX.withParameter(0, 1d));
            assertEquals(test.withPerturbation((i, v, m) => v + 1d).Curve, CURVE_NOFIX.withPerturbation((i, v, m) => v + 1d));
            assertEquals(test.findData(CURVE_NOFIX.Name), CURVE_NOFIX);
            assertEquals(test.findData(CurveName.of("Rubbish")), null);
            // check PriceIndexValues
            PriceIndexValues test2 = PriceIndexValues.of(US_CPI_U, VAL_DATE, CURVE_NOFIX, USCPI_TS);

            assertEquals(test, test2);
        }
예제 #2
0
 public virtual void test_parameter()
 {
     assertEquals(INSTANCE.getParameter(2), CURVE_NOFIX.getParameter(2));
 }