Пример #1
0
        public virtual void test_of_map()
        {
            ImmutableMap <IborIndex, IborFutureOptionVolatilitiesId> ids = ImmutableMap.of(USD_LIBOR_3M, VOL_ID1, USD_LIBOR_6M, VOL_ID1);
            IborFutureOptionMarketDataLookup test = IborFutureOptionMarketDataLookup.of(ids);

            assertEquals(test.queryType(), typeof(IborFutureOptionMarketDataLookup));
            assertEquals(test.VolatilityIndices, ImmutableSet.of(USD_LIBOR_3M, USD_LIBOR_6M));
            assertEquals(test.getVolatilityIds(USD_LIBOR_3M), ImmutableSet.of(VOL_ID1));
            assertThrowsIllegalArg(() => test.getVolatilityIds(GBP_LIBOR_3M));

            assertEquals(test.requirements(USD_LIBOR_3M), FunctionRequirements.builder().valueRequirements(VOL_ID1).build());
            assertEquals(test.requirements(ImmutableSet.of(USD_LIBOR_3M)), FunctionRequirements.builder().valueRequirements(VOL_ID1).build());
            assertThrowsIllegalArg(() => test.requirements(ImmutableSet.of(GBP_LIBOR_3M)));

            assertEquals(test.volatilities(USD_LIBOR_3M, MOCK_MARKET_DATA), MOCK_VOLS);
            assertThrowsIllegalArg(() => test.volatilities(GBP_LIBOR_3M, MOCK_MARKET_DATA));
        }
Пример #2
0
 //-------------------------------------------------------------------------
 public IborFutureOptionVolatilities volatilities(IborIndex index)
 {
     return(lookup.volatilities(index, marketData));
 }