public void ShouldUpdateModelWithDataFromServiceOnTickerSymbolSelected() { var historyService = new MockMarketHistoryService(); var eventAggregator = new MockEventAggregator(); var tickerSymbolSelected = new MockTickerSymbolSelectedEvent(); eventAggregator.AddMapping<TickerSymbolSelectedEvent>(tickerSymbolSelected); TrendLinePresentationModel presentationModel = new TrendLinePresentationModel(new MockTrendLineView(), historyService, eventAggregator); tickerSymbolSelected.SubscribeArgumentAction("MyTickerSymbol"); Assert.IsTrue(historyService.GetPriceHistoryCalled); Assert.AreEqual("MyTickerSymbol", historyService.GetPriceHistoryArgument); Assert.IsNotNull(presentationModel.HistoryCollection); Assert.AreEqual(historyService.Data.Count, presentationModel.HistoryCollection.Count); Assert.AreEqual(historyService.Data[0], presentationModel.HistoryCollection[0]); Assert.AreEqual("MyTickerSymbol", presentationModel.TickerSymbol); }
public void ShouldUpdateModelWithDataFromServiceOnTickerSymbolSelected() { var historyService = new MockMarketHistoryService(); var eventAggregator = new MockEventAggregator(); var tickerSymbolSelected = new MockTickerSymbolSelectedEvent(); eventAggregator.AddMapping <TickerSymbolSelectedEvent>(tickerSymbolSelected); TrendLinePresentationModel presentationModel = new TrendLinePresentationModel(new MockTrendLineView(), historyService, eventAggregator); tickerSymbolSelected.SubscribeArgumentAction("MyTickerSymbol"); Assert.IsTrue(historyService.GetPriceHistoryCalled); Assert.AreEqual("MyTickerSymbol", historyService.GetPriceHistoryArgument); Assert.IsNotNull(presentationModel.HistoryCollection); Assert.AreEqual(historyService.Data.Count, presentationModel.HistoryCollection.Count); Assert.AreEqual(historyService.Data[0], presentationModel.HistoryCollection[0]); Assert.AreEqual("MyTickerSymbol", presentationModel.TickerSymbol); }