Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs =================================================================== diff -u -r34d95e966db6e2d2d68bda8bfb6529f5788c5d3a -r1aebb54c436f6c01043d5ca18f74a99d825f43db --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision 34d95e966db6e2d2d68bda8bfb6529f5788c5d3a) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Forms/Views/StabilityPointStructuresFailureMechanismSectionResultRow.cs (.../StabilityPointStructuresFailureMechanismSectionResultRow.cs) (revision 1aebb54c436f6c01043d5ca18f74a99d825f43db) @@ -73,7 +73,7 @@ { get { - return SectionResult.AssessmentLayerTwoA; + return SectionResult.GetAssessmentLayerTwoA(failureMechanism, assessmentSection); } } Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs =================================================================== diff -u -r34d95e966db6e2d2d68bda8bfb6529f5788c5d3a -r1aebb54c436f6c01043d5ca18f74a99d825f43db --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs (.../StabilityPointStructuresFailureMechanismResultViewTest.cs) (revision 34d95e966db6e2d2d68bda8bfb6529f5788c5d3a) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismResultViewTest.cs (.../StabilityPointStructuresFailureMechanismResultViewTest.cs) (revision 1aebb54c436f6c01043d5ca18f74a99d825f43db) @@ -494,10 +494,9 @@ // Given using (StabilityPointStructuresFailureMechanismResultView view = CreateConfiguredFailureMechanismResultsView()) { - const double probability = 0.56789; var calculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.56789) }; FailureMechanismSection section = CreateSimpleFailureMechanismSection(); var sectionResult = new StabilityPointStructuresFailureMechanismSectionResult(section) @@ -519,7 +518,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); } } @@ -559,10 +558,9 @@ // Given using (StabilityPointStructuresFailureMechanismResultView view = CreateConfiguredFailureMechanismResultsView()) { - const double probability = 0.56789; var successfulCalculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.56789) }; var failedCalculation = new StructuresCalculation @@ -588,7 +586,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 @@ -670,7 +668,6 @@ private static IEnumerable AssessmentLayerOneStateIsSufficientVariousSections() { FailureMechanismSection section = CreateSimpleFailureMechanismSection(); - const double probability = 0.56789; yield return new TestCaseData(new StabilityPointStructuresFailureMechanismSectionResult(section) { @@ -694,9 +691,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/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs =================================================================== diff -u -r34d95e966db6e2d2d68bda8bfb6529f5788c5d3a -r1aebb54c436f6c01043d5ca18f74a99d825f43db --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision 34d95e966db6e2d2d68bda8bfb6529f5788c5d3a) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Forms.Test/Views/StabilityPointStructuresFailureMechanismSectionResultRowTest.cs (.../StabilityPointStructuresFailureMechanismSectionResultRowTest.cs) (revision 1aebb54c436f6c01043d5ca18f74a99d825f43db) @@ -134,12 +134,11 @@ public void AssessmentLayerTwoA_CalculationNotDone_ReturnNaN(CalculationScenarioStatus status) { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var failureMechanism = new StabilityPointStructuresFailureMechanism(); + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + var calculation = new StructuresCalculation(); if (status == CalculationScenarioStatus.Failed) { @@ -166,16 +165,14 @@ public void AssessmentLayerTwoA_CalculationSuccessful_ReturnAssessmentLayerTwoA() { // Setup - var mocks = new MockRepository(); - var assessmentSection = mocks.Stub(); - mocks.ReplayAll(); - var failureMechanism = new StabilityPointStructuresFailureMechanism(); - const double probability = 0.95; + var mocks = new MockRepository(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks); + var calculation = new StructuresCalculation { - Output = new TestStructuresOutput(probability) + Output = new TestStructuresOutput(0.95) }; FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection(); @@ -190,7 +187,7 @@ double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA; // Assert - Assert.AreEqual(probability, assessmentLayerTwoA); + Assert.AreEqual(0.17105612630848185, assessmentLayerTwoA); mocks.VerifyAll(); }