public void SetSiteData_SetsDataTableIntoView() { var view = new MockAggregateView(); var model = new MockEstimateService(); model.Data = new DataTable(); var presenter = new AggregateViewPresenter(view, model); presenter.SetSiteData(); Assert.AreSame(view.Data, model.Data); }
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); }
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); }