Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r4fd4b13639f6d6f3657c02916f60571bf940ee9c -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs (.../ClosingStructuresFailureMechanismResultViewInfoTest.cs) (revision 4fd4b13639f6d6f3657c02916f60571bf940ee9c) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismResultViewInfoTest.cs (.../ClosingStructuresFailureMechanismResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -91,18 +91,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var view = mocks.StrictMock(); - mocks.ReplayAll(); - - var failureMechanism = new ClosingStructuresFailureMechanism(); - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Resultaat", viewName); - mocks.VerifyAll(); } [Test] Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs (.../ClosingStructuresFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresFailureMechanismViewInfoTest.cs (.../ClosingStructuresFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithClosingStructuresFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithClosingStructuresFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/ViewInfos/ClosingStructuresScenariosViewInfoTest.cs (.../ClosingStructuresScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,17 +67,11 @@ [Test] public void GetViewName_Always_ReturnViewName() { - // Setup - using (var view = new ClosingStructuresScenariosView()) - { - var viewData = new CalculationGroup(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, viewData); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs (.../DuneErosionFailureMechanismResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismResultViewInfoTest.cs (.../DuneErosionFailureMechanismResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -87,16 +87,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new DuneErosionFailureMechanism(); - using (var view = new DuneErosionFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs (.../DuneErosionFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneErosionFailureMechanismViewInfoTest.cs (.../DuneErosionFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithDuneErosionFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithDuneErosionFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneLocationsViewInfoTest.cs =================================================================== diff -u -ra5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneLocationsViewInfoTest.cs (.../DuneLocationsViewInfoTest.cs) (revision a5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/ViewInfos/DuneLocationsViewInfoTest.cs (.../DuneLocationsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -62,24 +62,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + // Call + string viewName = info.GetViewName(null, null); - using (var view = new DuneLocationsView(new ObservableList(), - dl => new DuneLocationCalculation(), - new DuneErosionFailureMechanism(), - assessmentSection)) - { - // Call - string viewName = info.GetViewName(view, Enumerable.Empty()); - - // Assert - Assert.AreEqual("Hydraulische randvoorwaarden", viewName); - } - - mocks.VerifyAll(); + // Assert + Assert.AreEqual("Hydraulische randvoorwaarden", viewName); } [Test] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithGrassCoverErosionInwardsFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithGrassCoverErosionInwardsFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs =================================================================== diff -u -r8b60c9e846480f3ffeeb263bfea5d3367bf6bee3 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision 8b60c9e846480f3ffeeb263bfea5d3367bf6bee3) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsInputViewInfoTest.cs (.../GrassCoverErosionInwardsInputViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -66,17 +66,11 @@ [Test] public void GetViewName_Always_ReturnsInputResourceName() { - // Setup - using (var view = new GrassCoverErosionInwardsInputView()) - { - var calculation = new GrassCoverErosionInwardsCalculation(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, calculation); - - // Assert - Assert.AreEqual("Invoer", viewName); - } + // Assert + Assert.AreEqual("Invoer", viewName); } [Test] Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/ViewInfos/GrassCoverErosionInwardsScenariosViewInfoTest.cs (.../GrassCoverErosionInwardsScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,17 +67,11 @@ [Test] public void GetViewName_Always_ReturnViewName() { - // Setup - using (var view = new GrassCoverErosionInwardsScenariosView()) - { - var viewData = new CalculationGroup(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, viewData); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithGrassCoverErosionOutwardsFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithGrassCoverErosionOutwardsFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismViewInfoTest.cs (.../HeightStructuresFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismViewInfoTest.cs (.../HeightStructuresFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithHeightStructuresFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithHeightStructuresFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresScenariosViewInfoTest.cs (.../HeightStructuresScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,17 +67,11 @@ [Test] public void GetViewName_Always_ReturnViewName() { - // Setup - using (var view = new HeightStructuresScenariosView()) - { - var viewData = new CalculationGroup(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, viewData); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionViewInfoTest.cs =================================================================== diff -u -r802ea30d1fe8fbae93e58dff9ab054dbabca11ae -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionViewInfoTest.cs (.../AssessmentSectionViewInfoTest.cs) (revision 802ea30d1fe8fbae93e58dff9ab054dbabca11ae) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/AssessmentSectionViewInfoTest.cs (.../AssessmentSectionViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -63,19 +63,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var assessmentSection = mocks.Stub(); - var view = mocks.Stub(); - - mocks.ReplayAll(); - // Call - string viewName = info.GetViewName(view, assessmentSection); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Trajectkaart", viewName); - - mocks.VerifyAll(); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/CommentViewInfoTest.cs =================================================================== diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/CommentViewInfoTest.cs (.../CommentViewInfoTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/CommentViewInfoTest.cs (.../CommentViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,18 +67,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var comment = new Comment(); - var view = mocks.StrictMock(); - - mocks.ReplayAll(); - // Call - string viewName = info.GetViewName(view, comment); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Opmerkingen", viewName); - mocks.VerifyAll(); } [Test] @@ -152,6 +145,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -175,6 +169,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -202,6 +197,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -240,6 +236,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -280,6 +277,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -314,6 +312,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -348,6 +347,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -382,6 +382,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -416,6 +417,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -450,6 +452,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -487,6 +490,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -519,6 +523,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -553,6 +558,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -581,6 +587,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -669,6 +676,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -704,6 +712,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs =================================================================== diff -u -r317545a48353ace4c99d35bf5fd527c1731698dd -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision 317545a48353ace4c99d35bf5fd527c1731698dd) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/DesignWaterLevelLocationsViewInfoTest.cs (.../DesignWaterLevelLocationsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -70,18 +70,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - using (var view = new DesignWaterLevelLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), - new ObservableTestAssessmentSectionStub(), - () => 0.01)) - { - // Call - string viewName = info.GetViewName(view, Enumerable.Empty()); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Toetspeilen", viewName); - } + // Assert + Assert.AreEqual("Toetspeilen", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs =================================================================== diff -u -rf21ec839325d90ce1c5f0d08a8e743ebaf6912dd -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision f21ec839325d90ce1c5f0d08a8e743ebaf6912dd) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismContributionViewInfoTest.cs (.../FailureMechanismContributionViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -61,19 +61,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var viewCommands = mocks.Stub(); - IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(null, mocks); - mocks.ReplayAll(); - - var view = new FailureMechanismContributionView(viewCommands); - // Call - string viewName = info.GetViewName(view, assessmentSection.FailureMechanismContribution); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Faalkansbegroting", viewName); - mocks.VerifyAll(); } [Test] @@ -156,6 +148,7 @@ // Assert Assert.IsTrue(closeForData); } + mocks.VerifyAll(); } @@ -207,6 +200,7 @@ // Assert Assert.IsFalse(closeForData); } + mocks.VerifyAll(); } @@ -239,6 +233,7 @@ // Assert Assert.AreSame(view.AssessmentSection, assessmentSection); } + mocks.VerifyAll(); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs =================================================================== diff -u -r4bfca8ba56e6a94677f81c796cedb891e6664590 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs (.../FailureMechanismSectionsViewInfoTest.cs) (revision 4bfca8ba56e6a94677f81c796cedb891e6664590) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismSectionsViewInfoTest.cs (.../FailureMechanismSectionsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,18 +67,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var view = mocks.StrictMock(); - mocks.ReplayAll(); - - var failureMechanism = new TestFailureMechanism(); - // Call - string viewName = info.GetViewName(view, failureMechanism.Sections); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Vakindeling", viewName); - mocks.VerifyAll(); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismViewInfoTest.cs =================================================================== diff -u -r80cc77ed4382e822d305dbef5b8ac604d61ea02a -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismViewInfoTest.cs (.../FailureMechanismViewInfoTest.cs) (revision 80cc77ed4382e822d305dbef5b8ac604d61ea02a) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/FailureMechanismViewInfoTest.cs (.../FailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithTestFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithTestFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffInwardsResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffInwardsResultViewInfoTest.cs (.../GrassCoverSlipOffInwardsResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffInwardsResultViewInfoTest.cs (.../GrassCoverSlipOffInwardsResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -89,16 +89,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new GrassCoverSlipOffInwardsFailureMechanism(); - using (var view = new GrassCoverSlipOffInwardsResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffOutwardsResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffOutwardsResultViewInfoTest.cs (.../GrassCoverSlipOffOutwardsResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/GrassCoverSlipOffOutwardsResultViewInfoTest.cs (.../GrassCoverSlipOffOutwardsResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -74,7 +74,7 @@ // Setup var failureMechanism = new GrassCoverSlipOffOutwardsFailureMechanism(); var context = new FailureMechanismSectionResultContext( - failureMechanism.SectionResults, + failureMechanism.SectionResults, failureMechanism); mocks.ReplayAll(); @@ -89,16 +89,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new GrassCoverSlipOffOutwardsFailureMechanism(); - using (var view = new GrassCoverSlipOffOutwardsResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MacroStabilityOutwardsResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MacroStabilityOutwardsResultViewInfoTest.cs (.../MacroStabilityOutwardsResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MacroStabilityOutwardsResultViewInfoTest.cs (.../MacroStabilityOutwardsResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -85,18 +85,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new MacroStabilityOutwardsFailureMechanism(); - var view = mocks.StrictMock(); - - mocks.ReplayAll(); - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + string viewName = info.GetViewName(null, null); // Assert Assert.AreEqual("Resultaat", viewName); - mocks.VerifyAll(); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MicrostabilityResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MicrostabilityResultViewInfoTest.cs (.../MicrostabilityResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/MicrostabilityResultViewInfoTest.cs (.../MicrostabilityResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -88,16 +88,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new MicrostabilityFailureMechanism(); - using (var view = new MicrostabilityResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/PipingStructureResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/PipingStructureResultViewInfoTest.cs (.../PipingStructureResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/PipingStructureResultViewInfoTest.cs (.../PipingStructureResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -88,16 +88,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new PipingStructureFailureMechanism(); - using (var view = new PipingStructureResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/StrengthStabilityLengthwiseConstructionResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/StrengthStabilityLengthwiseConstructionResultViewInfoTest.cs (.../StrengthStabilityLengthwiseConstructionResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/StrengthStabilityLengthwiseConstructionResultViewInfoTest.cs (.../StrengthStabilityLengthwiseConstructionResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -85,16 +85,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new StrengthStabilityLengthwiseConstructionFailureMechanism(); - using (var view = new StrengthStabilityLengthwiseConstructionResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/TechnicalInnovationResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/TechnicalInnovationResultViewInfoTest.cs (.../TechnicalInnovationResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/TechnicalInnovationResultViewInfoTest.cs (.../TechnicalInnovationResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -87,16 +87,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new TechnicalInnovationFailureMechanism(); - using (var view = new TechnicalInnovationResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaterPressureAsphaltCoverResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaterPressureAsphaltCoverResultViewInfoTest.cs (.../WaterPressureAsphaltCoverResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaterPressureAsphaltCoverResultViewInfoTest.cs (.../WaterPressureAsphaltCoverResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -86,16 +86,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new WaterPressureAsphaltCoverFailureMechanism(); - using (var view = new WaterPressureAsphaltCoverResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs =================================================================== diff -u -r20e1c7320f826ad749b155d6fd5b521e3a2dbeee -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs (.../WaveConditionsInputViewInfoTest.cs) (revision 20e1c7320f826ad749b155d6fd5b521e3a2dbeee) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveConditionsInputViewInfoTest.cs (.../WaveConditionsInputViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -81,17 +81,11 @@ [Test] public void GetViewName_Always_ReturnsInputResourceName() { - // Setup - using (var view = new WaveConditionsInputView(new TestWaveConditionsInputViewStyle(), GetTestNormativeAssessmentLevel)) - { - var calculation = new TestWaveConditionsCalculation(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, calculation); - - // Assert - Assert.AreEqual("Invoer", viewName); - } + // Assert + Assert.AreEqual("Invoer", viewName); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs =================================================================== diff -u -r317545a48353ace4c99d35bf5fd527c1731698dd -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs (.../WaveHeightLocationsViewInfoTest.cs) (revision 317545a48353ace4c99d35bf5fd527c1731698dd) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/ViewInfos/WaveHeightLocationsViewInfoTest.cs (.../WaveHeightLocationsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -70,18 +70,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - using (var view = new WaveHeightLocationsView(new ObservableList(), - hbl => new HydraulicBoundaryLocationCalculation(), - new ObservableTestAssessmentSectionStub(), - () => 0.01)) - { - // Call - string viewName = info.GetViewName(view, Enumerable.Empty()); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Golfhoogtes", viewName); - } + // Assert + Assert.AreEqual("Golfhoogtes", viewName); } [Test] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs =================================================================== diff -u -r78382ec129ddc7537096860680cef36f3796700d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs (.../MacroStabilityInwardsCalculationsViewInfoTest.cs) (revision 78382ec129ddc7537096860680cef36f3796700d) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsCalculationsViewInfoTest.cs (.../MacroStabilityInwardsCalculationsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -89,22 +89,32 @@ } [Test] - public void GetViewName_Always_ReturnsCalculationGroupName() + public void GetViewName_WithMacroStabilityInwardsCalculationGroupContext_ReturnsCalculationGroupName() { // Setup + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculationsView = new MacroStabilityInwardsCalculationsView(); + + const string calculationGroupName = "Test"; + var calculationGroup = new CalculationGroup { - Name = "Test" + Name = calculationGroupName }; + var calculationGroupContext = new MacroStabilityInwardsCalculationGroupContext(calculationGroup, + null, + Enumerable.Empty(), + Enumerable.Empty(), + new MacroStabilityInwardsFailureMechanism(), + assessmentSection); // Call - string name = info.GetViewName(calculationsView, calculationGroup); + string name = info.GetViewName(calculationsView, calculationGroupContext); // Assert - Assert.AreEqual("Test", name); + Assert.AreEqual(calculationGroupName, name); mocks.VerifyAll(); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r7c037110f82f8b11269ece9edeef02c7f4d59c9b -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs) (revision 7c037110f82f8b11269ece9edeef02c7f4d59c9b) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -91,21 +91,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + // Call + string viewName = info.GetViewName(null, null); - var failureMechanism = new MacroStabilityInwardsFailureMechanism(); - using (var view = new MacroStabilityInwardsFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); - - // Assert - Assert.AreEqual("Resultaat", viewName); - } - - mocks.VerifyAll(); + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithMacroStabilityInwardsFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithMacroStabilityInwardsFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs =================================================================== diff -u -r89a30d666e2e684db9d72ed16c3be18a6afad391 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision 89a30d666e2e684db9d72ed16c3be18a6afad391) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsInputViewInfoTest.cs (.../MacroStabilityInwardsInputViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -68,17 +68,11 @@ [Test] public void GetViewName_Always_ReturnsInputResourceName() { - // Setup - using (var view = new MacroStabilityInwardsInputView()) - { - var calculationScenario = new MacroStabilityInwardsCalculationScenario(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, calculationScenario); - - // Assert - Assert.AreEqual("Invoer", viewName); - } + // Assert + Assert.AreEqual("Invoer", viewName); } [Test] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs =================================================================== diff -u -raee2e55bc9dbf0bbe1fac86898575c7faa33162c -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs (.../MacroStabilityInwardsOutputViewInfoTest.cs) (revision aee2e55bc9dbf0bbe1fac86898575c7faa33162c) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsOutputViewInfoTest.cs (.../MacroStabilityInwardsOutputViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -73,17 +73,11 @@ [Test] public void GetViewName_Always_ReturnsOutputResourceName() { - // Setup - using (var view = new MacroStabilityInwardsOutputView()) - { - var calculationScenario = new MacroStabilityInwardsCalculationScenario(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, calculationScenario); - - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsScenariosViewInfoTest.cs =================================================================== diff -u -ra5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsScenariosViewInfoTest.cs (.../MacroStabilityInwardsScenariosViewInfoTest.cs) (revision a5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsScenariosViewInfoTest.cs (.../MacroStabilityInwardsScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -87,23 +87,11 @@ [Test] public void GetViewName_Always_ReturnsScenarios() { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + // Call + string viewName = info.GetViewName(null, null); - var calculationsGroup = new CalculationGroup - { - Name = "Test" - }; - - using (var view = new MacroStabilityInwardsScenariosView(assessmentSection)) - { - // Call - string viewName = info.GetViewName(view, calculationsGroup); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs =================================================================== diff -u -r26f527fb809a2325c8f883ece9da01a8f8040eb3 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs (.../PipingCalculationsViewInfoTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingCalculationsViewInfoTest.cs (.../PipingCalculationsViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -89,22 +89,33 @@ } [Test] - public void GetViewName_Always_ReturnsCalculationGroupName() + public void GetViewName_WithPipingCalculationGroupContext_ReturnsCalculationGroupName() { // Setup + var assessmentSection = mocks.Stub(); mocks.ReplayAll(); var calculationsView = new PipingCalculationsView(); + + const string calculationGroupName = "Test"; + var calculationGroup = new CalculationGroup { - Name = "Test" + Name = calculationGroupName }; + var pipingCalculationGroupContext = new PipingCalculationGroupContext(calculationGroup, + null, + Enumerable.Empty(), + Enumerable.Empty(), + new PipingFailureMechanism(), + assessmentSection); + // Call - string name = info.GetViewName(calculationsView, calculationGroup); + string name = info.GetViewName(calculationsView, pipingCalculationGroupContext); // Assert - Assert.AreEqual("Test", name); + Assert.AreEqual(calculationGroupName, name); mocks.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs =================================================================== diff -u -r1a65cb67261da126d57a2c890acfb78b4347eb3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs (.../PipingFailureMechanismResultViewInfoTest.cs) (revision 1a65cb67261da126d57a2c890acfb78b4347eb3d) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs (.../PipingFailureMechanismResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -90,24 +90,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + // Call + string viewName = info.GetViewName(null, null); - var failureMechanism = new PipingFailureMechanism(); - - using (var view = new PipingFailureMechanismResultView(failureMechanism.SectionResults, - failureMechanism, - assessmentSection)) - { - // Call - string viewName = info.GetViewName(view, null); - - // Assert - Assert.AreEqual("Resultaat", viewName); - } - - mocks.VerifyAll(); + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismViewInfoTest.cs (.../PipingFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismViewInfoTest.cs (.../PipingFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithPipingFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithPipingFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingInputViewInfoTest.cs =================================================================== diff -u -r26f527fb809a2325c8f883ece9da01a8f8040eb3 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingInputViewInfoTest.cs (.../PipingInputViewInfoTest.cs) (revision 26f527fb809a2325c8f883ece9da01a8f8040eb3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingInputViewInfoTest.cs (.../PipingInputViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -68,17 +68,11 @@ [Test] public void GetViewName_Always_ReturnsInputResourceName() { - // Setup - using (var view = new PipingInputView()) - { - var calculationScenario = new PipingCalculationScenario(new GeneralPipingInput()); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, calculationScenario); - - // Assert - Assert.AreEqual("Invoer", viewName); - } + // Assert + Assert.AreEqual("Invoer", viewName); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingScenariosViewInfoTest.cs =================================================================== diff -u -ra5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingScenariosViewInfoTest.cs (.../PipingScenariosViewInfoTest.cs) (revision a5bf4f56dbf07e5cf48d0b874f5d46d7d02f0dba) +++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingScenariosViewInfoTest.cs (.../PipingScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -87,25 +87,11 @@ [Test] public void GetViewName_Always_ReturnsScenarios() { - // Setup - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); + // Call + string viewName = info.GetViewName(null, null); - var pipingCalculationsGroup = new CalculationGroup - { - Name = "Test" - }; - - using (var view = new PipingScenariosView(assessmentSection)) - { - // Call - string viewName = info.GetViewName(view, pipingCalculationsGroup); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } - - mocks.VerifyAll(); + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj =================================================================== diff -u -r951c6fb790f3ea3e0a89771b62ad323967746455 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj (.../Ringtoets.StabilityPointStructures.Plugin.Test.csproj) (revision 951c6fb790f3ea3e0a89771b62ad323967746455) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/Ringtoets.StabilityPointStructures.Plugin.Test.csproj (.../Ringtoets.StabilityPointStructures.Plugin.Test.csproj) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -48,7 +48,7 @@ - + Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismResultViewInfoTest.cs =================================================================== diff -u --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismResultViewInfoTest.cs (revision 0) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismResultViewInfoTest.cs (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -0,0 +1,299 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Core.Common.Controls.Views; +using Core.Common.Gui.Plugin; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.StabilityPointStructures.Data; +using Ringtoets.StabilityPointStructures.Forms.PresentationObjects; +using Ringtoets.StabilityPointStructures.Forms.Views; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.StabilityPointStructures.Plugin.Test.ViewInfos +{ + [TestFixture] + public class StabilityPointStructuresFailureMechanismResultViewInfoTest + { + private StabilityPointStructuresPlugin plugin; + private ViewInfo info; + + [SetUp] + public void SetUp() + { + plugin = new StabilityPointStructuresPlugin(); + info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(StabilityPointStructuresFailureMechanismResultView)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(ProbabilityFailureMechanismSectionResultContext), info.DataType); + Assert.AreEqual(typeof(IEnumerable), info.ViewDataType); + } + + [Test] + public void GetViewData_Always_ReturnsWrappedFailureMechanismResult() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var context = new ProbabilityFailureMechanismSectionResultContext( + failureMechanism.SectionResults, failureMechanism, assessmentSection); + + // Call + object viewData = info.GetViewData(context); + + // Assert + Assert.AreSame(failureMechanism.SectionResults, viewData); + mocks.VerifyAll(); + } + + [Test] + public void GetViewName_Always_ReturnsViewName() + { + // Call + string viewName = info.GetViewName(null, null); + + // Assert + Assert.AreEqual("Resultaat", viewName); + } + + [Test] + public void Image_Always_ReturnsGenericInputOutputIcon() + { + // Call + Image image = info.Image; + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, image); + } + + [Test] + public void CloseForData_AssessmentSectionRemovedWithoutFailureMechanism_ReturnsFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + var otherFailureMechanism = mocks.Stub("N", "C"); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] + { + otherFailureMechanism + }); + mocks.ReplayAll(); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + { + new TestFailureMechanism(), + failureMechanism + }); + mocks.ReplayAll(); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsTrue(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedFailureMechanism_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanism); + + // Assert + Assert.IsTrue(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanismContext_ReturnsFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, new StabilityPointStructuresFailureMechanism()); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var failureMechanismContext = new StabilityPointStructuresFailureMechanismContext(failureMechanism, assessmentSection); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsTrue(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanism_ReturnsFalse() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var failureMechanismContext = new StabilityPointStructuresFailureMechanismContext(new StabilityPointStructuresFailureMechanism(), + assessmentSection); + + using (var view = new StabilityPointStructuresFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism, assessmentSection)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CreateInstance_WithContext_ReturnsView() + { + // Setup + var failureMechanism = new StabilityPointStructuresFailureMechanism(); + + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + mocks.ReplayAll(); + + var context = new ProbabilityFailureMechanismSectionResultContext( + failureMechanism.SectionResults, + failureMechanism, + assessmentSection); + + // Call + IView view = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(view); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismViewInfoTest.cs (.../StabilityPointStructuresFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresFailureMechanismViewInfoTest.cs (.../StabilityPointStructuresFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithStabilityPointStructuresFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithStabilityPointStructuresFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Fisheye: Tag f07d6418a5280c74ea8a35de183dbaed51dda066 refers to a dead (removed) revision in file `Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresResultViewInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresScenariosViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresScenariosViewInfoTest.cs (.../StabilityPointStructuresScenariosViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/ViewInfos/StabilityPointStructuresScenariosViewInfoTest.cs (.../StabilityPointStructuresScenariosViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -67,17 +67,11 @@ [Test] public void GetViewName_Always_ReturnViewName() { - // Setup - using (var view = new StabilityPointStructuresScenariosView()) - { - var viewData = new CalculationGroup(); + // Call + string viewName = info.GetViewName(null, null); - // Call - string viewName = info.GetViewName(view, viewData); - - // Assert - Assert.AreEqual("Scenario's", viewName); - } + // Assert + Assert.AreEqual("Scenario's", viewName); } [Test] Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithStabilityStoneCoverFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithStabilityStoneCoverFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverResultViewInfoTest.cs =================================================================== diff -u -rf5b9652936357f6b97e4fc332b25f1c666248c3d -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverResultViewInfoTest.cs (.../StabilityStoneCoverResultViewInfoTest.cs) (revision f5b9652936357f6b97e4fc332b25f1c666248c3d) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverResultViewInfoTest.cs (.../StabilityStoneCoverResultViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -87,16 +87,11 @@ [Test] public void GetViewName_Always_ReturnsViewName() { - // Setup - var failureMechanism = new StabilityStoneCoverFailureMechanism(); - using (var view = new StabilityStoneCoverResultView(failureMechanism.SectionResults, failureMechanism)) - { - // Call - string viewName = info.GetViewName(view, failureMechanism.SectionResults); + // Call + string viewName = info.GetViewName(null, null); - // Assert - Assert.AreEqual("Resultaat", viewName); - } + // Assert + Assert.AreEqual("Resultaat", viewName); } [Test] Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj =================================================================== diff -u -r026939d282e7281edebc62e49794d9648e574382 -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj) (revision 026939d282e7281edebc62e49794d9648e574382) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj (.../Ringtoets.WaveImpactAsphaltCover.Plugin.Test.csproj) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -39,7 +39,7 @@ - + Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs =================================================================== diff -u --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs (revision 0) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -0,0 +1,306 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using Core.Common.Controls.Views; +using Core.Common.Gui.Plugin; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.PresentationObjects; +using Ringtoets.WaveImpactAsphaltCover.Data; +using Ringtoets.WaveImpactAsphaltCover.Forms.PresentationObjects; +using Ringtoets.WaveImpactAsphaltCover.Forms.Views; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.WaveImpactAsphaltCover.Plugin.Test.ViewInfos +{ + [TestFixture] + public class WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest + { + private MockRepository mocks; + private WaveImpactAsphaltCoverPlugin plugin; + private ViewInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new WaveImpactAsphaltCoverPlugin(); + info = plugin.GetViewInfos().First(tni => tni.ViewType == typeof(WaveImpactAsphaltCoverFailureMechanismResultView)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(FailureMechanismSectionResultContext), info.DataType); + Assert.AreEqual(typeof(IEnumerable), info.ViewDataType); + } + + [Test] + public void GetViewData_Always_ReturnsWrappedFailureMechanismResult() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var context = new FailureMechanismSectionResultContext( + failureMechanism.SectionResults, + failureMechanism); + + // Call + object viewData = info.GetViewData(context); + + // Assert + Assert.AreSame(failureMechanism.SectionResults, viewData); + } + + [Test] + public void GetViewName_Always_ReturnsViewName() + { + // Call + string viewName = info.GetViewName(null, null); + + // Assert + Assert.AreEqual("Resultaat", viewName); + } + + [Test] + public void ViewType_Always_ReturnsViewType() + { + // Call + Type viewType = info.ViewType; + + // Assert + Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismResultView), viewType); + } + + [Test] + public void DataType_Always_ReturnsDataType() + { + // Call + Type dataType = info.DataType; + + // Assert + Assert.AreEqual(typeof(FailureMechanismSectionResultContext), dataType); + } + + [Test] + public void ViewDataType_Always_ReturnsViewDataType() + { + // Call + Type viewDataType = info.ViewDataType; + + // Assert + Assert.AreEqual(typeof(IEnumerable), viewDataType); + } + + [Test] + public void Image_Always_ReturnsGenericInputOutputIcon() + { + // Call + Image image = info.Image; + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, image); + } + + [Test] + public void CloseForData_AssessmentSectionRemovedWithoutFailureMechanism_ReturnsFalse() + { + // Setup + var assessmentSection = mocks.Stub(); + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[0]); + mocks.ReplayAll(); + + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedAssessmentSection_ReturnsFalse() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var otherFailureMechanism = mocks.Stub("N", "C"); + + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new[] + { + otherFailureMechanism + }); + + mocks.ReplayAll(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedAssessmentSection_ReturnsTrue() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + assessmentSection.Stub(asm => asm.GetFailureMechanisms()).Return(new IFailureMechanism[] + { + new WaveImpactAsphaltCoverFailureMechanism(), + failureMechanism + }); + + mocks.ReplayAll(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, assessmentSection); + + // Assert + Assert.IsTrue(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedFailureMechanism_ReturnsTrue() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanism); + + // Assert + Assert.IsTrue(closeForData); + } + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanismContext_ReturnsFalse() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, new WaveImpactAsphaltCoverFailureMechanism()); + + // Assert + Assert.IsFalse(closeForData); + } + } + + [Test] + public void CloseForData_ViewCorrespondingToRemovedFailureMechanismContext_ReturnsTrue() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var failureMechanismContext = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, + assessmentSection); + + mocks.ReplayAll(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsTrue(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CloseForData_ViewNotCorrespondingToRemovedFailureMechanism_ReturnsFalse() + { + // Setup + var assessmentSection = mocks.Stub(); + var failureMechanismContext = new WaveImpactAsphaltCoverFailureMechanismContext(new WaveImpactAsphaltCoverFailureMechanism(), + assessmentSection); + mocks.ReplayAll(); + + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + + using (var view = new WaveImpactAsphaltCoverFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) + { + // Call + bool closeForData = info.CloseForData(view, failureMechanismContext); + + // Assert + Assert.IsFalse(closeForData); + } + + mocks.VerifyAll(); + } + + [Test] + public void CreateInstance_WithContext_ReturnsView() + { + // Setup + var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); + var context = new FailureMechanismSectionResultContext( + failureMechanism.SectionResults, + failureMechanism); + + // Call + IView view = info.CreateInstance(context); + + // Assert + Assert.IsInstanceOf(view); + } + } +} \ No newline at end of file Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs =================================================================== diff -u -rf7a5d22408a43c70b20a9eb5ee79cb336bacdf9e -rf07d6418a5280c74ea8a35de183dbaed51dda066 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision f7a5d22408a43c70b20a9eb5ee79cb336bacdf9e) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision f07d6418a5280c74ea8a35de183dbaed51dda066) @@ -64,7 +64,7 @@ } [Test] - public void GetViewName_WithWaveImpactAsphaltCoverFailureMechanism_ReturnsNameOfFailureMechanism() + public void GetViewName_WithWaveImpactAsphaltCoverFailureMechanismContext_ReturnsNameOfFailureMechanism() { // Setup var assessmentSection = mocks.Stub(); Fisheye: Tag f07d6418a5280c74ea8a35de183dbaed51dda066 refers to a dead (removed) revision in file `Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverResultViewInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff?