ViewDelegate { void marketData(Closure<?> body) { body.setDelegate(_marketDataDelegate); body.call(); }    }
@Test public void marketData() { String scriptText = "view {\n" + " marketData {\n" + " live 'Bloomberg'\n" + " live 'Activ'\n" + " snapshot 'the snapshot name'\n" + " fixedHistorical '2011-03-08 11:30'\n" + " latestHistorical\n" + " fixedHistorical '2012-03-10 12:30'\n" + " }\n" + "}"; StandAloneScenarioScript script = createScript(scriptText); ImmutableList<MarketDataDelegate.MarketDataSpec> expectedSpecs = ImmutableList.of(spec(LIVE, "Bloomberg"), spec(LIVE, "Activ"), spec(SNAPSHOT, "the snapshot name"), spec(FIXED_HISTORICAL, "2011-03-08 11:30"), spec(LATEST_HISTORICAL, null), spec(FIXED_HISTORICAL, "2012-03-10 12:30")); MarketDataDelegate marketDataDelegate = script.getViewDelegate().getMarketDataDelegate(); assertEquals(expectedSpecs, marketDataDelegate.getSpecifications()); }