コード例 #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 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);
        }
コード例 #3
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);
        }
コード例 #4
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]);
        }