Esempio n. 1
0
        public virtual void test_rate_afterValuation()
        {
            SimpleIborIndexRates test = SimpleIborIndexRates.of(GBP_LIBOR_3M, DATE_VAL, CURVE, SERIES);
            double time     = CURVE_DAY_COUNT.yearFraction(DATE_VAL, GBP_LIBOR_3M_AFTER.MaturityDate);
            double expected = CURVE.yValue(time);

            assertEquals(test.rate(GBP_LIBOR_3M_AFTER), expected, TOLERANCE_RATE);
        }
Esempio n. 2
0
        public virtual void test_rate_onValuation_noFixing()
        {
            SimpleIborIndexRates test = SimpleIborIndexRates.of(GBP_LIBOR_3M, DATE_VAL, CURVE, SERIES_EMPTY);
            double time     = CURVE_DAY_COUNT.yearFraction(DATE_VAL, GBP_LIBOR_3M_VAL.MaturityDate);
            double expected = CURVE.yValue(time);

            assertEquals(test.rate(GBP_LIBOR_3M_VAL), expected, TOLERANCE_RATE);
            assertEquals(test.rateIgnoringFixings(GBP_LIBOR_3M_VAL), expected, TOLERANCE_RATE);
        }
Esempio n. 3
0
        public virtual void test_rate_onValuation_fixing()
        {
            SimpleIborIndexRates test = SimpleIborIndexRates.of(GBP_LIBOR_3M, DATE_VAL, CURVE, SERIES);

            assertEquals(test.rate(GBP_LIBOR_3M_VAL), RATE_VAL);
        }
Esempio n. 4
0
        public virtual void test_rate_beforeValuation_noFixing_notEmptySeries()
        {
            SimpleIborIndexRates test = SimpleIborIndexRates.of(GBP_LIBOR_3M, DATE_VAL, CURVE, SERIES_MINIMAL);

            assertThrowsIllegalArg(() => test.rate(GBP_LIBOR_3M_BEFORE));
        }