예제 #1
0
        public void SetSiteData_PopulatesViewDataWithModel()
        {
            // Arrange
            var view      = new MockAggregateView();
            var model     = new MockEstimatesQueryService();
            var presenter = new AggregateViewPresenter(view, model);

            // Act
            presenter.SetSiteData();

            // Assert
            Assert.AreEqual <DataTable>(view.Data, model.Data);
        }
예제 #2
0
        public void SetSiteData_HandlesException()
        {
            // Arrange
            var view            = new MockAggregateView();
            var model           = new MockEstimatesQueryService(new InvalidOperationException("test"));
            var presenter       = new AggregateViewPresenter(view, model);
            var errorVisualizer = new MockErrorVisualizer();

            presenter.ErrorVisualizer  = errorVisualizer;
            presenter.ExceptionHandler = new MockViewExceptionHandler();

            // Act
            presenter.SetSiteData();

            // Assert
            Assert.AreEqual <string>("test", errorVisualizer.ErrorMessage);
        }