Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs =================================================================== diff -u -r958c44f070f86bf30625f7ecff8eafb1e51f9a90 -r8ed5614b7eaddc3cc4b42b9bab875ef50cc9feeb --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs) (revision 958c44f070f86bf30625f7ecff8eafb1e51f9a90) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs) (revision 8ed5614b7eaddc3cc4b42b9bab875ef50cc9feeb) @@ -314,6 +314,60 @@ } [Test] + public void CloseViewForData_ForMatchingContext_ReturnsTrue() + { + // Setup + var context = new WaterLevelCalculationsForUserDefinedTargetProbabilityContext( + new HydraulicBoundaryLocationCalculationsForTargetProbability(), + new AssessmentSectionStub()); + + using (var view = new DesignWaterLevelCalculationsView(context.WrappedData.HydraulicBoundaryLocationCalculations, + new AssessmentSectionStub(), + () => 0.01, + "1/100")) + using (var plugin = new RiskeerPlugin()) + { + view.Data = context.WrappedData.HydraulicBoundaryLocationCalculations; + + ViewInfo info = GetViewInfo(plugin); + + // Call + bool closeForData = info.CloseForData(view, context); + + // Assert + Assert.IsTrue(closeForData); + } + } + + [Test] + public void CloseViewForData_ForNonMatchingContext_ReturnsFalse() + { + // Setup + var context = new WaterLevelCalculationsForUserDefinedTargetProbabilityContext( + new HydraulicBoundaryLocationCalculationsForTargetProbability(), + new AssessmentSectionStub()); + + var otherCalculations = new ObservableList(); + + using (var view = new DesignWaterLevelCalculationsView(otherCalculations, + new AssessmentSectionStub(), + () => 0.01, + "1/100")) + using (var plugin = new RiskeerPlugin()) + { + view.Data = otherCalculations; + + ViewInfo info = GetViewInfo(plugin); + + // Call + bool closeForData = info.CloseForData(view, context); + + // Assert + Assert.IsFalse(closeForData); + } + } + + [Test] public void CloseViewForData_ForMatchingAssessmentSection_ReturnsTrue() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs =================================================================== diff -u -r5fe7b49e62b7d27a57a95870332aa7dc9dc7d689 -r8ed5614b7eaddc3cc4b42b9bab875ef50cc9feeb --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs) (revision 5fe7b49e62b7d27a57a95870332aa7dc9dc7d689) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/ViewInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextViewInfoTest.cs) (revision 8ed5614b7eaddc3cc4b42b9bab875ef50cc9feeb) @@ -314,6 +314,60 @@ } [Test] + public void CloseViewForData_ForMatchingContext_ReturnsTrue() + { + // Setup + var context = new WaveHeightCalculationsForUserDefinedTargetProbabilityContext( + new HydraulicBoundaryLocationCalculationsForTargetProbability(), + new AssessmentSectionStub()); + + using (var view = new WaveHeightCalculationsView(context.WrappedData.HydraulicBoundaryLocationCalculations, + new AssessmentSectionStub(), + () => 0.01, + "1/100")) + using (var plugin = new RiskeerPlugin()) + { + view.Data = context.WrappedData.HydraulicBoundaryLocationCalculations; + + ViewInfo info = GetViewInfo(plugin); + + // Call + bool closeForData = info.CloseForData(view, context); + + // Assert + Assert.IsTrue(closeForData); + } + } + + [Test] + public void CloseViewForData_ForNonMatchingContext_ReturnsFalse() + { + // Setup + var context = new WaveHeightCalculationsForUserDefinedTargetProbabilityContext( + new HydraulicBoundaryLocationCalculationsForTargetProbability(), + new AssessmentSectionStub()); + + var otherCalculations = new ObservableList(); + + using (var view = new WaveHeightCalculationsView(otherCalculations, + new AssessmentSectionStub(), + () => 0.01, + "1/100")) + using (var plugin = new RiskeerPlugin()) + { + view.Data = otherCalculations; + + ViewInfo info = GetViewInfo(plugin); + + // Call + bool closeForData = info.CloseForData(view, context); + + // Assert + Assert.IsFalse(closeForData); + } + } + + [Test] public void CloseViewForData_ForMatchingAssessmentSection_ReturnsTrue() { // Setup