Пример #1
0
        public void CanInitPresenter()
        {
            ITrendLineView view = new MockTrendLineView();
            IMarketHistoryService historyService = new MockMarketHistoryService();
            TrendLinePresenter presenter = new TrendLinePresenter(view, historyService);

            Assert.IsNotNull(presenter);
        }
Пример #2
0
        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);
        }
Пример #3
0
        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]);
        }