Fisheye: Tag 91b6773de2fccf52417609b4ed9463f98d6451dd refers to a dead (removed) revision in file `Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSection2aAssessmentResultExtensions.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensions.cs =================================================================== diff -u --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensions.cs (revision 0) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensions.cs (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -0,0 +1,73 @@ +// 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 Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Probability; + +namespace Ringtoets.HeightStructures.Data +{ + /// + /// Extension methods for obtaining detailed assessment probabilities from output for an assessment of the + /// height structures failure mechanism. + /// + public static class HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensions + { + /// + /// Gets the value for the detailed assessment of safety per failure mechanism section as a probability. + /// + /// The section result to get the detailed assessment probability for. + /// The failure mechanism the calculations belong to. + /// The assessment section the calculations belong to. + /// The calculated detailed assessment probability; or when there is no + /// calculation assigned to the section result or the calculation is not performed. + /// Thrown when any parameter is null. + public static double GetDetailedAssessmentProbability(this HeightStructuresFailureMechanismSectionResult sectionResult, + HeightStructuresFailureMechanism failureMechanism, + IAssessmentSection assessmentSection) + { + if (sectionResult == null) + { + throw new ArgumentNullException(nameof(sectionResult)); + } + + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); + } + + if (sectionResult.Calculation == null || !sectionResult.Calculation.HasOutput) + { + return double.NaN; + } + + ProbabilityAssessmentOutput derivedOutput = HeightStructuresProbabilityAssessmentOutputFactory.Create(sectionResult.Calculation.Output, + failureMechanism, assessmentSection); + + return derivedOutput.Probability; + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/Ringtoets.HeightStructures.Data.csproj =================================================================== diff -u -rd7696913d8f9239cb80eb2c3bac6cc0ccf23d479 -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/Ringtoets.HeightStructures.Data.csproj (.../Ringtoets.HeightStructures.Data.csproj) (revision d7696913d8f9239cb80eb2c3bac6cc0ccf23d479) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Data/Ringtoets.HeightStructures.Data.csproj (.../Ringtoets.HeightStructures.Data.csproj) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -14,7 +14,7 @@ - + Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs =================================================================== diff -u -rc7425b8f799095f2dc812351e14103931c672fba -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision c7425b8f799095f2dc812351e14103931c672fba) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismResultView.cs (.../HeightStructuresFailureMechanismResultView.cs) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -42,7 +42,7 @@ public class HeightStructuresFailureMechanismResultView : FailureMechanismResultView { - private const int assessmentLayerTwoAIndex = 2; + private const int detailedAssessmentIndex = 2; private readonly IAssessmentSection assessmentSection; private readonly RecursiveObserver calculationInputObserver; private readonly RecursiveObserver calculationOutputObserver; @@ -130,7 +130,7 @@ nameof(EnumDisplayWrapper.DisplayName)); DataGridViewControl.AddTextBoxColumn( - nameof(HeightStructuresFailureMechanismSectionResultRow.AssessmentLayerTwoA), + nameof(HeightStructuresFailureMechanismSectionResultRow.DetailedAssessmentProbability), RingtoetsCommonFormsResources.FailureMechanismResultView_DetailedAssessment_ColumnHeader, true); DataGridViewControl.AddTextBoxColumn( @@ -161,7 +161,7 @@ private void ShowAssessmentLayerErrors(object sender, DataGridViewCellFormattingEventArgs e) { - if (e.ColumnIndex != assessmentLayerTwoAIndex) + if (e.ColumnIndex != detailedAssessmentIndex) { return; } @@ -172,7 +172,7 @@ FailureMechanismSectionResultRowHelper.SetDetailedAssessmentError(currentDataGridViewCell, resultRow.AssessmentLayerOne, - resultRow.AssessmentLayerTwoA, + resultRow.DetailedAssessmentProbability, normativeCalculation); } } Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r19ca2288de4540bb03df71fc86cca6b456e8fc37 -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 19ca2288de4540bb03df71fc86cca6b456e8fc37) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -37,6 +37,7 @@ { private readonly HeightStructuresFailureMechanism failureMechanism; private readonly IAssessmentSection assessmentSection; + /// /// Creates a new instance of . /// @@ -98,14 +99,14 @@ } /// - /// Gets the value representing the result of the layer 2a assessment. + /// Gets the value representing the detailed assessment probability. /// [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] - public double AssessmentLayerTwoA + public double DetailedAssessmentProbability { get { - return SectionResult.GetAssessmentLayerTwoA(failureMechanism, assessmentSection); + return SectionResult.GetDetailedAssessmentProbability(failureMechanism, assessmentSection); } } Fisheye: Tag 91b6773de2fccf52417609b4ed9463f98d6451dd refers to a dead (removed) revision in file `Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSection2aAssessmentResultExtensionsTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensionsTest.cs =================================================================== diff -u --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensionsTest.cs (revision 0) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensionsTest.cs (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -0,0 +1,161 @@ +// 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 NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.HeightStructures.Data.TestUtil; + +namespace Ringtoets.HeightStructures.Data.Test +{ + [TestFixture] + public class HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensionsTest + { + [Test] + public void GetDetailedAssessmentProbability_SectionResultNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + // Call + TestDelegate call = () => HeightStructuresFailureMechanismSectionDetailedAssessmentResultExtensions.GetDetailedAssessmentProbability( + null, + new HeightStructuresFailureMechanism(), + assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("sectionResult", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void GetDetailedAssessmentProbability_FailureMechanismNull_ThrowsArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section); + + // Call + TestDelegate call = () => failureMechanismSectionResult.GetDetailedAssessmentProbability(null, assessmentSection); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("failureMechanism", exception.ParamName); + mocks.VerifyAll(); + } + + [Test] + public void GetDetailedAssessmentProbability_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Setup + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section); + + // Call + TestDelegate call = () => failureMechanismSectionResult.GetDetailedAssessmentProbability(new HeightStructuresFailureMechanism(), null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("assessmentSection", exception.ParamName); + } + + [Test] + public void GetDetailedAssessmentProbability_SectionResultWithoutCalculation_ReturnsNaN() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section); + + // Call + double detailedAssessmentProbability = failureMechanismSectionResult.GetDetailedAssessmentProbability(new HeightStructuresFailureMechanism(), + assessmentSection); + + // Assert + Assert.IsNaN(detailedAssessmentProbability); + mocks.VerifyAll(); + } + + [Test] + public void GetDetailedAssessmentProbability_CalculationWithoutOutput_ReturnsNaN() + { + // Setup + var mocks = new MockRepository(); + var assessmentSection = mocks.Stub(); + mocks.ReplayAll(); + + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section) + { + Calculation = new TestHeightStructuresCalculation() + }; + + // Call + double detailedAssessmentProbability = failureMechanismSectionResult.GetDetailedAssessmentProbability(new HeightStructuresFailureMechanism(), + assessmentSection); + + // Assert + Assert.IsNaN(detailedAssessmentProbability); + mocks.VerifyAll(); + } + + [Test] + public void GetDetailedAssessmentProbability_CalculationWithOutput_ReturnsDerivedProbability() + { + // Setup + var failureMechanism = new HeightStructuresFailureMechanism(); + + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + mocks.ReplayAll(); + + FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); + var failureMechanismSectionResult = new HeightStructuresFailureMechanismSectionResult(section) + { + Calculation = new TestHeightStructuresCalculation + { + Output = new TestStructuresOutput(0.8) + } + }; + + // Call + double detailedAssessmentProbability = failureMechanismSectionResult.GetDetailedAssessmentProbability(new HeightStructuresFailureMechanism(), + assessmentSection); + + // Assert + Assert.AreEqual(0.21185539858339669, detailedAssessmentProbability); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/Ringtoets.HeightStructures.Data.Test.csproj =================================================================== diff -u -rd7696913d8f9239cb80eb2c3bac6cc0ccf23d479 -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/Ringtoets.HeightStructures.Data.Test.csproj (.../Ringtoets.HeightStructures.Data.Test.csproj) (revision d7696913d8f9239cb80eb2c3bac6cc0ccf23d479) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/Ringtoets.HeightStructures.Data.Test.csproj (.../Ringtoets.HeightStructures.Data.Test.csproj) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -20,7 +20,7 @@ - + Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs =================================================================== diff -u -r33ce6fa967e380d4c68bd5f53acc189ab7f1e726 -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs (.../HeightStructuresFailureMechanismResultViewTest.cs) (revision 33ce6fa967e380d4c68bd5f53acc189ab7f1e726) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs (.../HeightStructuresFailureMechanismResultViewTest.cs) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -47,7 +47,7 @@ { private const int nameColumnIndex = 0; private const int assessmentLayerOneIndex = 1; - private const int assessmentLayerTwoAIndex = 2; + private const int detailedAssessmentIndex = 2; private const int assessmentLayerThreeIndex = 3; private Form testForm; @@ -110,14 +110,14 @@ var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; Assert.AreEqual(4, dataGridView.ColumnCount); - Assert.IsTrue(dataGridView.Columns[assessmentLayerTwoAIndex].ReadOnly); + Assert.IsTrue(dataGridView.Columns[detailedAssessmentIndex].ReadOnly); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerOneIndex]); - Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerTwoAIndex]); + Assert.IsInstanceOf(dataGridView.Columns[detailedAssessmentIndex]); Assert.IsInstanceOf(dataGridView.Columns[assessmentLayerThreeIndex]); Assert.AreEqual("Eenvoudige toets", dataGridView.Columns[assessmentLayerOneIndex].HeaderText); - Assert.AreEqual("Gedetailleerde toets per vak", dataGridView.Columns[assessmentLayerTwoAIndex].HeaderText); + Assert.AreEqual("Gedetailleerde toets per vak", dataGridView.Columns[detailedAssessmentIndex].HeaderText); Assert.AreEqual("Toets op maat", dataGridView.Columns[assessmentLayerThreeIndex].HeaderText); Assert.AreEqual(DataGridViewAutoSizeColumnsMode.AllCells, dataGridView.AutoSizeColumnsMode); @@ -141,14 +141,14 @@ Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); Assert.AreEqual(AssessmentLayerOneState.NotAssessed, cells[assessmentLayerOneIndex].Value); - Assert.AreEqual("-", cells[assessmentLayerTwoAIndex].FormattedValue); + Assert.AreEqual("-", cells[detailedAssessmentIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerThreeIndex].FormattedValue); cells = rows[1].Cells; Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 2", cells[nameColumnIndex].FormattedValue); Assert.AreEqual(AssessmentLayerOneState.NotAssessed, cells[assessmentLayerOneIndex].Value); - Assert.AreEqual("-", cells[assessmentLayerTwoAIndex].FormattedValue); + Assert.AreEqual("-", cells[detailedAssessmentIndex].FormattedValue); Assert.AreEqual("-", cells[assessmentLayerThreeIndex].FormattedValue); } } @@ -174,25 +174,25 @@ DataGridViewCellCollection cells = rows[0].Cells; Assert.AreEqual(4, cells.Count); Assert.AreEqual("Section 1", cells[nameColumnIndex].FormattedValue); - DataGridViewCell cellAssessmentLayerTwoA = cells[assessmentLayerTwoAIndex]; + DataGridViewCell detailedAssessmentCell = cells[detailedAssessmentIndex]; DataGridViewCell cellAssessmentLayerThree = cells[assessmentLayerThreeIndex]; DataGridViewCell dataGridViewCell = cells[assessmentLayerOneIndex]; Assert.AreEqual(assessmentLayerOneState, cells[assessmentLayerOneIndex].Value); - Assert.AreEqual("-", cellAssessmentLayerTwoA.FormattedValue); + Assert.AreEqual("-", detailedAssessmentCell.FormattedValue); Assert.AreEqual("-", cellAssessmentLayerThree.FormattedValue); Assert.IsEmpty(dataGridViewCell.ErrorText); if (assessmentLayerOneState == AssessmentLayerOneState.Sufficient) { - DataGridViewTestHelper.AssertCellIsDisabled(cellAssessmentLayerTwoA); + DataGridViewTestHelper.AssertCellIsDisabled(detailedAssessmentCell); DataGridViewTestHelper.AssertCellIsDisabled(cellAssessmentLayerThree); Assert.IsTrue(cellAssessmentLayerThree.ReadOnly); } else { - DataGridViewTestHelper.AssertCellIsEnabled(cellAssessmentLayerTwoA, true); + DataGridViewTestHelper.AssertCellIsEnabled(detailedAssessmentCell, true); DataGridViewTestHelper.AssertCellIsEnabled(cellAssessmentLayerThree); Assert.IsFalse(cellAssessmentLayerThree.ReadOnly); @@ -266,7 +266,7 @@ [Test] [TestCase(AssessmentLayerOneState.NotAssessed)] [TestCase(AssessmentLayerOneState.NoVerdict)] - public void GivenSectionResultWithoutCalculation_ThenLayerTwoAErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) + public void GivenSectionResultWithoutCalculation_ThenDetailedAssessmentErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) { // Given var sectionResult = new HeightStructuresFailureMechanismSectionResult(CreateSimpleFailureMechanismSection()) @@ -282,7 +282,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // When object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. @@ -296,7 +296,7 @@ [Test] [TestCase(AssessmentLayerOneState.NotAssessed)] [TestCase(AssessmentLayerOneState.NoVerdict)] - public void GivenSectionResultAndCalculationNotCalculated_ThenLayerTwoAErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) + public void GivenSectionResultAndCalculationNotCalculated_ThenDetailedAssessmentErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) { // Given var sectionResult = new HeightStructuresFailureMechanismSectionResult(CreateSimpleFailureMechanismSection()) @@ -314,7 +314,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // When object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. @@ -328,7 +328,7 @@ [Test] [TestCase(AssessmentLayerOneState.NotAssessed)] [TestCase(AssessmentLayerOneState.NoVerdict)] - public void GivenSectionResultAndFailedCalculation_ThenLayerTwoAErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) + public void GivenSectionResultAndFailedCalculation_ThenDetailedAssessmentErrorTooltip(AssessmentLayerOneState assessmentLayerOneState) { // Given var calculation = new StructuresCalculation @@ -351,7 +351,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // When object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. @@ -365,7 +365,7 @@ [Test] [TestCase(AssessmentLayerOneState.NotAssessed)] [TestCase(AssessmentLayerOneState.NoVerdict)] - public void GivenSectionResultAndSuccessfulCalculation_ThenLayerTwoANoError(AssessmentLayerOneState assessmentLayerOneState) + public void GivenSectionResultAndSuccessfulCalculation_ThenDetailedAssessmentNoError(AssessmentLayerOneState assessmentLayerOneState) { // Given var sectionResult = new HeightStructuresFailureMechanismSectionResult(CreateSimpleFailureMechanismSection()) @@ -386,7 +386,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // When object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. @@ -399,7 +399,7 @@ [Test] [TestCaseSource(nameof(AssessmentLayerOneStateIsSufficientVariousSections))] - public void GivenSectionResultAndAssessmentLayerOneStateSufficient_ThenLayerTwoANoError( + public void GivenSectionResultAndAssessmentLayerOneStateSufficient_ThenDetailedAssessmentNoError( HeightStructuresFailureMechanismSectionResult sectionResult, string expectedValue) { // Given @@ -412,7 +412,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // When object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. @@ -426,7 +426,7 @@ [Test] [TestCase(AssessmentLayerOneState.NotAssessed)] [TestCase(AssessmentLayerOneState.NoVerdict)] - public void GivenSectionResultAndSuccessfulCalculation_WhenChangingCalculationToFailed_ThenLayerTwoAHasError( + public void GivenSectionResultAndSuccessfulCalculation_WhenChangingCalculationToFailed_ThenDetailedAssessmentHasError( AssessmentLayerOneState assessmentLayerOneState) { // Given @@ -447,7 +447,7 @@ var gridTester = new ControlTester("dataGridView"); var dataGridView = (DataGridView) gridTester.TheObject; - DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[assessmentLayerTwoAIndex]; + DataGridViewCell dataGridViewCell = dataGridView.Rows[0].Cells[detailedAssessmentIndex]; // Precondition object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -ra493758b8df1196d55fc8e4552e271eafddbbefe -r91b6773de2fccf52417609b4ed9463f98d6451dd --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision a493758b8df1196d55fc8e4552e271eafddbbefe) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision 91b6773de2fccf52417609b4ed9463f98d6451dd) @@ -58,11 +58,11 @@ // Assert Assert.IsInstanceOf>(row); Assert.AreEqual(result.AssessmentLayerOne, row.AssessmentLayerOne); - Assert.AreEqual(result.GetAssessmentLayerTwoA(failureMechanism, assessmentSection), row.AssessmentLayerTwoA); + Assert.AreEqual(result.GetDetailedAssessmentProbability(failureMechanism, assessmentSection), row.DetailedAssessmentProbability); Assert.AreEqual(row.AssessmentLayerThree, result.AssessmentLayerThree); TestHelper.AssertTypeConverter( - nameof(HeightStructuresFailureMechanismSectionResultRow.AssessmentLayerTwoA)); + nameof(HeightStructuresFailureMechanismSectionResultRow.DetailedAssessmentProbability)); TestHelper.AssertTypeConverter( nameof(HeightStructuresFailureMechanismSectionResultRow.AssessmentLayerThree)); mocks.VerifyAll(); @@ -133,7 +133,7 @@ } [Test] - public void AssessmentLayerTwoA_NoCalculationSet_ReturnNaN() + public void DetailedAssessmentProbability_NoCalculationSet_ReturnNaN() { // Setup var mocks = new MockRepository(); @@ -151,17 +151,17 @@ var resultRow = new HeightStructuresFailureMechanismSectionResultRow(sectionResult, failureMechanism, assessmentSection); // Call - double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA; + double detailedAssessmentProbability = resultRow.DetailedAssessmentProbability; // Assert - Assert.IsNaN(assessmentLayerTwoA); + Assert.IsNaN(detailedAssessmentProbability); mocks.VerifyAll(); } [Test] [TestCase(CalculationScenarioStatus.Failed)] [TestCase(CalculationScenarioStatus.NotCalculated)] - public void AssessmentLayerTwoA_CalculationNotDone_ReturnNaN(CalculationScenarioStatus status) + public void DetailedAssessmentProbability_CalculationNotDone_ReturnNaN(CalculationScenarioStatus status) { // Setup var failureMechanism = new HeightStructuresFailureMechanism(); @@ -185,15 +185,15 @@ var resultRow = new HeightStructuresFailureMechanismSectionResultRow(sectionResult, failureMechanism, assessmentSection); // Call - double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA; + double detailedAssessmentProbability = resultRow.DetailedAssessmentProbability; // Assert - Assert.IsNaN(assessmentLayerTwoA); + Assert.IsNaN(detailedAssessmentProbability); mocks.VerifyAll(); } [Test] - public void AssessmentLayerTwoA_CalculationSuccessful_ReturnAssessmentLayerTwoA() + public void DetailedAssessmentProbability_CalculationSuccessful_ReturnDetailedAssessmentProbability() { // Setup var failureMechanism = new HeightStructuresFailureMechanism(); @@ -216,10 +216,10 @@ var resultRow = new HeightStructuresFailureMechanismSectionResultRow(sectionResult, failureMechanism, assessmentSection); // Call - double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA; + double detailedAssessmentProbability = resultRow.DetailedAssessmentProbability; // Assert - Assert.AreEqual(0.17105612630848185, assessmentLayerTwoA); + Assert.AreEqual(0.17105612630848185, detailedAssessmentProbability); mocks.VerifyAll(); }