public void CanInitPresenter() { ITrendLineView view = new MockTrendLineView(); IMarketHistoryService historyService = new MockMarketHistoryService(); TrendLinePresenter presenter = new TrendLinePresenter(view, historyService); Assert.IsNotNull(presenter); }
public void OnTickerSymbolSelectedUpdatesChartTitle() { MockTrendLineView view = new MockTrendLineView(); MockMarketHistoryService historyService = new MockMarketHistoryService(); TrendLinePresenter presenter = new TrendLinePresenter(view, historyService); presenter.OnTickerSymbolSelected("TEST"); Assert.AreEqual("TEST", view.ChartTitlePassed); }
public void OnTickerSymbolSelectedUpdatesLineChartWithPriceHistoryData() { MockTrendLineView view = new MockTrendLineView(); MockMarketHistoryService historyService = new MockMarketHistoryService(); TrendLinePresenter presenter = new TrendLinePresenter(view, historyService); presenter.OnTickerSymbolSelected("TEST"); Assert.IsNotNull(view.HistoryCollectionPassed); Assert.AreEqual(historyService.Data.Count, view.HistoryCollectionPassed.Count); Assert.AreEqual(historyService.Data[0], view.HistoryCollectionPassed[0]); }