public void CanInitPresenter()
        {
            ITrendLineView view = new MockTrendLineView();
            IMarketHistoryService historyService = new MockMarketHistoryService();
            TrendLinePresenter presenter = new TrendLinePresenter(view, historyService);

            Assert.IsNotNull(presenter);
        }
        public void CanInitPresenter()
        {
            var historyService = new MockMarketHistoryService();
            var view = new MockTrendLineView();
            var eventAggregator = new MockEventAggregator();
            eventAggregator.AddMapping<TickerSymbolSelectedEvent>(new MockTickerSymbolSelectedEvent());
            TrendLinePresentationModel presentationModel = new TrendLinePresentationModel(view, historyService, eventAggregator);

            Assert.IsNotNull(presentationModel);
        }
        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]);
        }