Index: Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -rfd2c44967bae1db12a907fc8790ad47b6ab17170 -ra2905a96f036363105b042cd8866c878def9eb46 --- Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision fd2c44967bae1db12a907fc8790ad47b6ab17170) +++ Ringtoets/HeightStructures/src/Ringtoets.HeightStructures.Forms/Views/HeightStructuresFailureMechanismSectionResultRow.cs (.../HeightStructuresFailureMechanismSectionResultRow.cs) (revision a2905a96f036363105b042cd8866c878def9eb46) @@ -88,7 +88,7 @@ { get { - return SectionResult.AssessmentLayerTwoA; + return SectionResult.GetAssessmentLayerTwoA(failureMechanism, assessmentSection); } } Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs =================================================================== diff -u -rfd2c44967bae1db12a907fc8790ad47b6ab17170 -ra2905a96f036363105b042cd8866c878def9eb46 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs (.../HeightStructuresFailureMechanismResultViewTest.cs) (revision fd2c44967bae1db12a907fc8790ad47b6ab17170) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismResultViewTest.cs (.../HeightStructuresFailureMechanismResultViewTest.cs) (revision a2905a96f036363105b042cd8866c878def9eb46) @@ -411,10 +411,9 @@ // Given using (HeightStructuresFailureMechanismResultView view = ShowFullyConfiguredFailureMechanismResultsView()) { - const double probability = 0.56789; var calculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.56789) }; FailureMechanismSection section = CreateSimpleFailureMechanismSection(); var sectionResult = new HeightStructuresFailureMechanismSectionResult(section) @@ -437,7 +436,7 @@ object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. // Then - Assert.AreEqual(ProbabilityFormattingHelper.Format(probability), formattedValue); + Assert.AreEqual(ProbabilityFormattingHelper.Format(0.25), formattedValue); Assert.IsEmpty(dataGridViewCell.ErrorText); } } @@ -477,10 +476,9 @@ // Given using (HeightStructuresFailureMechanismResultView view = ShowFullyConfiguredFailureMechanismResultsView()) { - const double probability = 0.56789; var successfulCalculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.56789) }; var failedCalculation = new StructuresCalculation @@ -506,7 +504,7 @@ // Precondition object formattedValue = dataGridViewCell.FormattedValue; // Need to do this to fire the CellFormatting event. - Assert.AreEqual(ProbabilityFormattingHelper.Format(probability), formattedValue); + Assert.AreEqual(ProbabilityFormattingHelper.Format(0.25), formattedValue); Assert.IsEmpty(dataGridViewCell.ErrorText); // When @@ -522,7 +520,6 @@ private static IEnumerable AssessmentLayerOneStateIsSufficientVariousSections() { FailureMechanismSection section = CreateSimpleFailureMechanismSection(); - const double probability = 0.56789; yield return new TestCaseData(new HeightStructuresFailureMechanismSectionResult(section) { @@ -546,9 +543,9 @@ AssessmentLayerOne = AssessmentLayerOneState.Sufficient, Calculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.56789) } - }, ProbabilityFormattingHelper.Format(probability)).SetName("SectionWithValidCalculationOutput"); + }, ProbabilityFormattingHelper.Format(0.25)).SetName("SectionWithValidCalculationOutput"); } private static FailureMechanismSection CreateSimpleFailureMechanismSection() Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -rfd2c44967bae1db12a907fc8790ad47b6ab17170 -ra2905a96f036363105b042cd8866c878def9eb46 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision fd2c44967bae1db12a907fc8790ad47b6ab17170) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/Views/HeightStructuresFailureMechanismSectionResultRowTest.cs (.../HeightStructuresFailureMechanismSectionResultRowTest.cs) (revision a2905a96f036363105b042cd8866c878def9eb46) @@ -133,12 +133,11 @@ public void AssessmentLayerTwoA_CalculationNotDone_ReturnNaN(CalculationScenarioStatus status) { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var failureMechanism = new HeightStructuresFailureMechanism(); + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + var calculation = new StructuresCalculation(); if (status == CalculationScenarioStatus.Failed) { @@ -165,16 +164,14 @@ public void AssessmentLayerTwoA_CalculationSuccessful_ReturnAssessmentLayerTwoA() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var failureMechanism = new HeightStructuresFailureMechanism(); - const double reliability = 0.95; + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + var calculation = new StructuresCalculation { - Output = new TestStructuresOutput(reliability) + Output = new TestStructuresOutput(0.95) }; FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -189,7 +186,7 @@ double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA; // Assert - Assert.AreEqual(reliability, assessmentLayerTwoA); + Assert.AreEqual(0.17105612630848185, assessmentLayerTwoA); mocks.VerifyAll(); }