Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -r2b2b747a35d38d092eca298599e82ce88ee6e2d3 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs (.../WaveHeightLocationsViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs (.../WaveHeightLocationsViewInfoTest.cs) (revision 2b2b747a35d38d092eca298599e82ce88ee6e2d3) @@ -24,6 +24,7 @@ using System.Drawing; using System.Linq; using System.Threading; +using Core.Common.Base; using Core.Common.Gui; using Core.Common.Gui.Commands; using Core.Common.Gui.Forms.MainWindow; @@ -64,7 +65,7 @@ public void GetViewName_Always_ReturnsViewName() { // Setup - using (var view = new WaveHeightLocationsView(new ObservableTestAssessmentSectionStub())) + using (var view = new WaveHeightLocationsView(new ObservableList(), new ObservableTestAssessmentSectionStub(), () => 0.01)) { // Call string viewName = info.GetViewName(view, Enumerable.Empty()); @@ -105,33 +106,27 @@ } [Test] - public void GetViewData_Always_ReturnsHydraulicBoundaryDatabase() + public void GetViewData_Always_ReturnsHydraulicBoundaryLocations() { // Setup - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = hydraulicBoundaryDatabase - }; + var assessmentSection = new ObservableTestAssessmentSectionStub(); + ObservableList locations = assessmentSection.HydraulicBoundaryDatabase.Locations; - var context = new WaveHeightLocationsContext(assessmentSection); + var context = new WaveHeightLocationsContext(locations, assessmentSection); // Call object viewData = info.GetViewData(context); // Assert - Assert.AreSame(hydraulicBoundaryDatabase.Locations, viewData); + Assert.AreSame(locations, viewData); } [Test] public void CreateInstance_Always_SetExpectedProperties() { // Setup - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase() - }; - var context = new WaveHeightLocationsContext(assessmentSection); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + var context = new WaveHeightLocationsContext(new ObservableList(), assessmentSection); using (var ringtoetsPlugin = new RingtoetsPlugin()) { @@ -160,13 +155,11 @@ mocks.ReplayAll(); - var assessmentSection = new ObservableTestAssessmentSectionStub - { - HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase() - }; - var context = new WaveHeightLocationsContext(assessmentSection); + var assessmentSection = new ObservableTestAssessmentSectionStub(); + var locations = new ObservableList(); + var context = new WaveHeightLocationsContext(locations, assessmentSection); - using (var view = new WaveHeightLocationsView(assessmentSection)) + using (var view = new WaveHeightLocationsView(locations, assessmentSection, () => 0.01)) using (var ringtoetsPlugin = new RingtoetsPlugin()) { info = ringtoetsPlugin.GetViewInfos().First(tni => tni.ViewType == typeof(WaveHeightLocationsView)); @@ -188,7 +181,7 @@ // Setup var assessmentSection = new ObservableTestAssessmentSectionStub(); - using (var view = new WaveHeightLocationsView(assessmentSection)) + using (var view = new WaveHeightLocationsView(new ObservableList(), assessmentSection, () => 0.01)) { // Call bool closeForData = info.CloseForData(view, assessmentSection); @@ -205,7 +198,7 @@ var assessmentSectionA = new ObservableTestAssessmentSectionStub(); var assessmentSectionB = new ObservableTestAssessmentSectionStub(); - using (var view = new WaveHeightLocationsView(assessmentSectionA)) + using (var view = new WaveHeightLocationsView(new ObservableList(), assessmentSectionA, () => 0.01)) { // Call bool closeForData = info.CloseForData(view, assessmentSectionB); @@ -221,9 +214,8 @@ // Setup var assessmentSectionA = new ObservableTestAssessmentSectionStub(); - using (var view = new WaveHeightLocationsView(assessmentSectionA)) + using (var view = new WaveHeightLocationsView(new ObservableList(), assessmentSectionA, () => 0.01)) { - view.Data = assessmentSectionA; // Call bool closeForData = info.CloseForData(view, new object()); @@ -232,19 +224,5 @@ Assert.IsFalse(closeForData); } } - - [Test] - public void CloseViewForData_ViewDataNull_ReturnsFalse() - { - // Setup - using (var view = new WaveHeightLocationsView(new ObservableTestAssessmentSectionStub())) - { - // Call - bool closeForData = info.CloseForData(view, new object()); - - // Assert - Assert.IsFalse(closeForData); - } - } } } \ No newline at end of file