final String delimitedTrade = "T|S|2.3m|R|GBPUSD|1.6324";
final TradeTranslator tradeTranslator = context.mock(TradeTranslator.class);
final MarketEvent marketEvent = context.mock(MarketEvent.class);
final Trade trade = context.mock(Trade.class);
final MarketTradeEventHandler h = new MarketTradeEventHandler(tradeTranslator);
context.checking(new Expectations(){{
oneOf(marketEvent).getMessage();
will(returnValue(delimitedTrade));
oneOf(tradeTranslator).canHandle(delimitedTrade);
will(returnValue(true));
oneOf(tradeTranslator).translate(delimitedTrade);
will(returnValue(trade));
oneOf(marketEvent).accept(with(any(Trade.class)));
}});
h.onEvent(marketEvent, 1, true);
}