Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs
===================================================================
diff -u -r7d89262d3b971dceec1e987e22d0027bf675c196 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 7d89262d3b971dceec1e987e22d0027bf675c196)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -1730,7 +1730,6 @@
(expectedItem, actualItem) =>
{
Assert.AreEqual(expectedItem.AssessmentLayerOne, actualItem.AssessmentLayerOne);
- Assert.AreEqual(expectedItem.AssessmentLayerTwoA, actualItem.AssessmentLayerTwoA);
Assert.AreEqual(expectedItem.AssessmentLayerThree, actualItem.AssessmentLayerThree);
if (expectedItem.Calculation == null)
{
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs
===================================================================
diff -u -r5f5fc9c9799816757fca63a82f5d86aadb262d2f -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision 5f5fc9c9799816757fca63a82f5d86aadb262d2f)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/GrassCoverErosionInwardsFailureMechanismSectionResult.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResult.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -44,21 +44,6 @@
}
///
- /// Gets the value of assessment layer two a.
- ///
- public double AssessmentLayerTwoA
- {
- get
- {
- if (Calculation == null || !Calculation.HasOutput)
- {
- return double.NaN;
- }
- return Calculation.Output.OvertoppingOutput.ProbabilityAssessmentOutput.Probability;
- }
- }
-
- ///
/// Gets or sets the , which is chosen
/// to be representative for the whole section.
///
Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs
===================================================================
diff -u -r1b10713698cbe378c5e0be2b73ddb14e514fcdd7 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision 1b10713698cbe378c5e0be2b73ddb14e514fcdd7)
+++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRow.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -90,7 +90,7 @@
{
get
{
- return SectionResult.AssessmentLayerTwoA;
+ return SectionResult.GetAssessmentLayerTwoA(failureMechanism, assessmentSection);
}
}
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs
===================================================================
diff -u -rf4049b9b0967513aeadfddb1fe58efa3b3aa1677 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision f4049b9b0967513aeadfddb1fe58efa3b3aa1677)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultTest.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -44,7 +44,6 @@
Assert.IsInstanceOf(result);
Assert.AreSame(section, result.Section);
Assert.IsNaN(result.AssessmentLayerThree);
- Assert.IsNaN(result.AssessmentLayerTwoA);
}
[Test]
@@ -63,71 +62,6 @@
}
[Test]
- public void AssessmentLayerTwoA_CalculationNull_ReturnNaN()
- {
- // Setup
- FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
-
- var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section)
- {
- Calculation = null
- };
-
- // Call
- double twoAValue = result.AssessmentLayerTwoA;
-
- // Assert
- Assert.IsNaN(twoAValue);
- }
-
- [Test]
- public void AssessmentLayerTwoA_FailedCalculation_ReturnNaN()
- {
- // Setup
- FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
-
- var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section)
- {
- Calculation = new GrassCoverErosionInwardsCalculation
- {
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(double.NaN),
- new TestDikeHeightOutput(double.NaN),
- new TestOvertoppingRateOutput(double.NaN))
- }
- };
-
- // Call
- double twoAValue = result.AssessmentLayerTwoA;
-
- // Assert
- Assert.IsNaN(twoAValue);
- }
-
- [Test]
- public void AssessmentLayerTwoA_SuccessfulCalculation_ReturnProbability()
- {
- // Setup
- FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
-
- const double probability = 0.65;
- var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section)
- {
- Calculation = new GrassCoverErosionInwardsCalculation
- {
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(probability),
- new TestDikeHeightOutput(double.NaN),
- new TestOvertoppingRateOutput(double.NaN))
- }
- };
-
- // Call
- double twoAValue = result.AssessmentLayerTwoA;
-
- // Assert
- Assert.AreEqual(probability, twoAValue);
- }
-
- [Test]
[SetCulture("nl-NL")]
[TestCase(double.NegativeInfinity)]
[TestCase(double.PositiveInfinity)]
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil.Test/TestOvertoppingOutputTest.cs
===================================================================
diff -u -rce064290e953de172eb5823ad4caceb0342a0796 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil.Test/TestOvertoppingOutputTest.cs (.../TestOvertoppingOutputTest.cs) (revision ce064290e953de172eb5823ad4caceb0342a0796)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil.Test/TestOvertoppingOutputTest.cs (.../TestOvertoppingOutputTest.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -32,20 +32,21 @@
public void Constructor_ExpectedValues()
{
// Setup
- const double probability = 0.3;
+ const double reliability = 0.3;
// Call
- var output = new TestOvertoppingOutput(probability);
+ var output = new TestOvertoppingOutput(reliability);
// Assert
Assert.IsInstanceOf(output);
Assert.AreEqual(1.0, output.WaveHeight.Value);
Assert.IsTrue(output.IsOvertoppingDominant);
+ Assert.AreEqual(reliability, output.Reliability);
ProbabilityAssessmentOutput probabilityAssessmentOutput = output.ProbabilityAssessmentOutput;
Assert.AreEqual(0, probabilityAssessmentOutput.FactorOfSafety, probabilityAssessmentOutput.FactorOfSafety.GetAccuracy());
- Assert.AreEqual(probability, probabilityAssessmentOutput.Probability);
+ Assert.AreEqual(0, probabilityAssessmentOutput.Probability);
Assert.AreEqual(0, probabilityAssessmentOutput.Reliability, probabilityAssessmentOutput.Reliability.GetAccuracy());
Assert.AreEqual(0, probabilityAssessmentOutput.RequiredProbability);
Assert.AreEqual(0, probabilityAssessmentOutput.RequiredReliability, probabilityAssessmentOutput.RequiredReliability.GetAccuracy());
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/TestOvertoppingOutput.cs
===================================================================
diff -u -r6306f61e82936c6bb6db70c4a185243cb07f00af -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/TestOvertoppingOutput.cs (.../TestOvertoppingOutput.cs) (revision 6306f61e82936c6bb6db70c4a185243cb07f00af)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/TestOvertoppingOutput.cs (.../TestOvertoppingOutput.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -32,8 +32,8 @@
///
/// Creates a new instance of .
///
- /// The probability to set to the output.
- public TestOvertoppingOutput(double probability)
- : base(1, true, 0, new ProbabilityAssessmentOutput(0, 0, probability, 0, 0), null) {}
+ /// The reliability to set to the output.
+ public TestOvertoppingOutput(double reliability)
+ : base(1, true, reliability, new ProbabilityAssessmentOutput(0, 0, 0, 0, 0), null) {}
}
}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs
===================================================================
diff -u -r1b10713698cbe378c5e0be2b73ddb14e514fcdd7 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision 1b10713698cbe378c5e0be2b73ddb14e514fcdd7)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismResultViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismResultViewTest.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -422,10 +422,9 @@
// Given
using (GrassCoverErosionInwardsFailureMechanismResultView view = ShowFullyConfiguredFailureMechanismResultsView())
{
- const double probability = 0.56789;
var calculation = new GrassCoverErosionInwardsCalculation
{
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(probability),
+ Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(0.56789),
new TestDikeHeightOutput(0),
new TestOvertoppingRateOutput(0))
};
@@ -449,7 +448,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);
}
}
@@ -489,10 +488,9 @@
// Given
using (GrassCoverErosionInwardsFailureMechanismResultView view = ShowFullyConfiguredFailureMechanismResultsView())
{
- const double probability = 0.56789;
var successfulCalculation = new GrassCoverErosionInwardsCalculation
{
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(probability),
+ Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(0.56789),
new TestDikeHeightOutput(0),
new TestOvertoppingRateOutput(0))
};
@@ -522,7 +520,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
@@ -538,7 +536,7 @@
private static IEnumerable AssessmentLayerOneStateIsSufficientVariousSectionResults()
{
FailureMechanismSection section = CreateSimpleFailureMechanismSection();
- const double probability = 0.56789;
+ const double reliability = 0.56789;
yield return new TestCaseData(new GrassCoverErosionInwardsFailureMechanismSectionResult(section)
{
@@ -564,11 +562,11 @@
AssessmentLayerOne = AssessmentLayerOneState.Sufficient,
Calculation = new GrassCoverErosionInwardsCalculation
{
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(probability),
+ Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(reliability),
new TestDikeHeightOutput(0),
new TestOvertoppingRateOutput(0))
}
- }, ProbabilityFormattingHelper.Format(probability)).SetName("SectionWithValidCalculationOutput");
+ }, ProbabilityFormattingHelper.Format(0.25)).SetName("SectionWithValidCalculationOutput");
}
private static FailureMechanismSection CreateSimpleFailureMechanismSection()
Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs
===================================================================
diff -u -r1b10713698cbe378c5e0be2b73ddb14e514fcdd7 -r798ea39ea76cdab602fae22326d16083b143e3d4
--- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 1b10713698cbe378c5e0be2b73ddb14e514fcdd7)
+++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs (.../GrassCoverErosionInwardsFailureMechanismSectionResultRowTest.cs) (revision 798ea39ea76cdab602fae22326d16083b143e3d4)
@@ -42,12 +42,11 @@
public void Constructor_WithParameters_ExpectedValues()
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
+ var mocks = new MockRepository();
+ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
+
FailureMechanismSection section = FailureMechanismSectionTestFactory.CreateFailureMechanismSection();
var result = new GrassCoverErosionInwardsFailureMechanismSectionResult(section);
@@ -56,7 +55,7 @@
// Assert
Assert.IsInstanceOf>(row);
- Assert.AreEqual(result.AssessmentLayerTwoA, row.AssessmentLayerTwoA);
+ Assert.AreEqual(result.GetAssessmentLayerTwoA(failureMechanism, assessmentSection), row.AssessmentLayerTwoA);
Assert.AreEqual(row.AssessmentLayerThree, result.AssessmentLayerThree);
TestHelper.AssertTypeConverter(
@@ -132,12 +131,11 @@
public void AssessmentLayerTwoA_CalculationNotDone_ReturnNaN(CalculationScenarioStatus status)
{
// Setup
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
+ var mocks = new MockRepository();
+ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
+
var calculation = new GrassCoverErosionInwardsCalculation();
if (status == CalculationScenarioStatus.Failed)
{
@@ -166,16 +164,14 @@
public void AssessmentLayerTwoA_CalculationSuccessful_ReturnAssessmentLayerTwoA()
{
// Setup
- const double probability = 0.95;
- var mocks = new MockRepository();
- var assessmentSection = mocks.Stub();
- mocks.ReplayAll();
-
var failureMechanism = new GrassCoverErosionInwardsFailureMechanism();
+ var mocks = new MockRepository();
+ IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
+
var calculation = new GrassCoverErosionInwardsCalculation
{
- Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(probability),
+ Output = new GrassCoverErosionInwardsOutput(new TestOvertoppingOutput(0.95),
new TestDikeHeightOutput(0),
new TestOvertoppingRateOutput(0))
};
@@ -192,7 +188,7 @@
double assessmentLayerTwoA = resultRow.AssessmentLayerTwoA;
// Assert
- Assert.AreEqual(probability, assessmentLayerTwoA);
+ Assert.AreEqual(0.17105612630848185, assessmentLayerTwoA);
mocks.VerifyAll();
}