//------------------------------------------------------------------------- public virtual void test_marketDataView() { IborFutureOptionMarketDataLookup test = IborFutureOptionMarketDataLookup.of(USD_LIBOR_3M, VOL_ID1); LocalDate valDate = date(2015, 6, 30); ScenarioMarketData md = new TestMarketDataMap(valDate, ImmutableMap.of(), ImmutableMap.of()); IborFutureOptionScenarioMarketData multiScenario = test.marketDataView(md); assertEquals(multiScenario.Lookup, test); assertEquals(multiScenario.MarketData, md); assertEquals(multiScenario.ScenarioCount, 1); IborFutureOptionMarketData scenario = multiScenario.scenario(0); assertEquals(scenario.Lookup, test); assertEquals(scenario.MarketData, md.scenario(0)); assertEquals(scenario.ValuationDate, valDate); }
//------------------------------------------------------------------------- public virtual void test_marketDataView() { ImmutableMap <SecurityId, RepoGroup> repoSecurityGroups = ImmutableMap.of(SEC_A1, GROUP_REPO_X); ImmutableMap <Pair <RepoGroup, Currency>, CurveId> repoCurves = ImmutableMap.of(Pair.of(GROUP_REPO_X, USD), CURVE_ID_USD1); ImmutableMap <LegalEntityId, LegalEntityGroup> issuerGroups = ImmutableMap.of(ISSUER_A, GROUP_ISSUER_M); ImmutableMap <Pair <LegalEntityGroup, Currency>, CurveId> issuerCurves = ImmutableMap.of(Pair.of(GROUP_ISSUER_M, USD), CURVE_ID_USD3); LegalEntityDiscountingMarketDataLookup test = LegalEntityDiscountingMarketDataLookup.of(repoSecurityGroups, ImmutableMap.of(), repoCurves, issuerGroups, issuerCurves); LocalDate valDate = date(2015, 6, 30); ScenarioMarketData md = new TestMarketDataMap(valDate, ImmutableMap.of(), ImmutableMap.of()); LegalEntityDiscountingScenarioMarketData multiScenario = test.marketDataView(md); assertEquals(multiScenario.Lookup, test); assertEquals(multiScenario.MarketData, md); assertEquals(multiScenario.ScenarioCount, 1); LegalEntityDiscountingMarketData scenario = multiScenario.scenario(0); assertEquals(scenario.Lookup, test); assertEquals(scenario.MarketData, md.scenario(0)); assertEquals(scenario.ValuationDate, valDate); }