Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs =================================================================== diff -u -r3e7db9d95e07d438ec99f8488ec184848655b98c -r3992a077683baeefad7b74e04ed498e18e953c6a --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 3e7db9d95e07d438ec99f8488ec184848655b98c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/IntegrationTests/StorageSqLiteIntegrationTest.cs (.../StorageSqLiteIntegrationTest.cs) (revision 3992a077683baeefad7b74e04ed498e18e953c6a) @@ -398,24 +398,6 @@ } } - private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) - { - var expectedSectionResultsArray = expectedSectionResults.ToArray(); - var actualSectionResultsArray = actualSectionResults.ToArray(); - - Assert.AreEqual(expectedSectionResultsArray.Length, actualSectionResultsArray.Length); - - for (var i = 0; i < expectedSectionResultsArray.Length; i++) - { - ClosingStructuresFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; - ClosingStructuresFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; - - Assert.AreEqual(expectedSection.AssessmentLayerOne, actualSection.AssessmentLayerOne); - Assert.AreEqual(expectedSection.AssessmentLayerTwoA, actualSection.AssessmentLayerTwoA); - Assert.AreEqual(expectedSection.AssessmentLayerThree, actualSection.AssessmentLayerThree); - } - } - private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) { var expectedSectionResultsArray = expectedSectionResults.ToArray(); @@ -541,23 +523,6 @@ } } - private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) - { - var expectedSectionResultsArray = expectedSectionResults.ToArray(); - var actualSectionResultsArray = actualSectionResults.ToArray(); - - Assert.AreEqual(expectedSectionResultsArray.Length, actualSectionResultsArray.Length); - - for (var i = 0; i < expectedSectionResultsArray.Length; i++) - { - StabilityPointStructuresFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; - StabilityPointStructuresFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; - - Assert.AreEqual(expectedSection.AssessmentLayerTwoA, actualSection.AssessmentLayerTwoA); - Assert.AreEqual(expectedSection.AssessmentLayerThree, actualSection.AssessmentLayerThree); - } - } - private static void AssertFailureMechanism(IFailureMechanism expectedFailureMechanism, IFailureMechanism actualFailureMechanism) { Assert.AreEqual(expectedFailureMechanism.Name, actualFailureMechanism.Name); @@ -732,7 +697,7 @@ var expectedStabilityPointStructuresCalculation = expectedChild as StructuresCalculation; if (expectedStabilityPointStructuresCalculation != null) { - AssertStructuresCalculation(expectedStabilityPointStructuresCalculation, (StructuresCalculation)actualChild); + AssertStructuresCalculation(expectedStabilityPointStructuresCalculation, (StructuresCalculation) actualChild); } var expectedStabilityStoneCoverWaveConditionsCalculation = expectedChild as StabilityStoneCoverWaveConditionsCalculation; if (expectedStabilityStoneCoverWaveConditionsCalculation != null) @@ -929,6 +894,23 @@ AssertCalculationGroup(expectedFailureMechanism.CalculationsGroup, actualFailureMechanism.CalculationsGroup); } + private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) + { + var expectedSectionResultsArray = expectedSectionResults.ToArray(); + var actualSectionResultsArray = actualSectionResults.ToArray(); + + Assert.AreEqual(expectedSectionResultsArray.Length, actualSectionResultsArray.Length); + + for (var i = 0; i < expectedSectionResultsArray.Length; i++) + { + StabilityPointStructuresFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; + StabilityPointStructuresFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; + + Assert.AreEqual(expectedSection.AssessmentLayerTwoA, actualSection.AssessmentLayerTwoA); + Assert.AreEqual(expectedSection.AssessmentLayerThree, actualSection.AssessmentLayerThree); + } + } + private static void AssertStabilityPointStructures(ObservableList expectedStabilityPointStructures, ObservableList actualStabilityPointStructures) { @@ -1044,6 +1026,24 @@ AssertCalculationGroup(expectedFailureMechanism.CalculationsGroup, actualFailureMechanism.CalculationsGroup); } + private static void AssertFailureMechanismSectionResults(IEnumerable expectedSectionResults, IEnumerable actualSectionResults) + { + var expectedSectionResultsArray = expectedSectionResults.ToArray(); + var actualSectionResultsArray = actualSectionResults.ToArray(); + + Assert.AreEqual(expectedSectionResultsArray.Length, actualSectionResultsArray.Length); + + for (var i = 0; i < expectedSectionResultsArray.Length; i++) + { + ClosingStructuresFailureMechanismSectionResult expectedSection = expectedSectionResultsArray[i]; + ClosingStructuresFailureMechanismSectionResult actualSection = actualSectionResultsArray[i]; + + Assert.AreEqual(expectedSection.AssessmentLayerOne, actualSection.AssessmentLayerOne); + Assert.AreEqual(expectedSection.AssessmentLayerTwoA, actualSection.AssessmentLayerTwoA); + Assert.AreEqual(expectedSection.AssessmentLayerThree, actualSection.AssessmentLayerThree); + } + } + private static void AssertClosingStructures(ObservableList expectedClosingStructures, ObservableList actualClosingStructures) { Assert.AreEqual(expectedClosingStructures.Count, actualClosingStructures.Count); @@ -1083,7 +1083,7 @@ Assert.AreEqual(expectedCalculation.Comments, actualCalculation.Comments); AssertClosingStructuresInput(expectedCalculation.InputParameters, actualCalculation.InputParameters); - + if (expectedCalculation.HasOutput) { AssertProbabilityAssessmentOutput(expectedCalculation.Output, actualCalculation.Output); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs =================================================================== diff -u -r3e7db9d95e07d438ec99f8488ec184848655b98c -r3992a077683baeefad7b74e04ed498e18e953c6a --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 3e7db9d95e07d438ec99f8488ec184848655b98c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 3992a077683baeefad7b74e04ed498e18e953c6a) @@ -243,7 +243,6 @@ var waveImpactAsphaltCoverCalculationWithOutput = (WaveImpactAsphaltCoverWaveConditionsCalculation)failureMechanism.WaveConditionsCalculationGroup.Children[2]; Assert.IsTrue(waveImpactAsphaltCoverCalculationWithOutput.HasOutput); Assert.AreEqual(2, waveImpactAsphaltCoverCalculationWithOutput.Output.Items.Count()); - Assert.AreEqual(2, waveImpactAsphaltCoverCalculationWithOutput.Output.Items.Count()); } private static void AssertHeightStructuresFailureMechanism(AssessmentSection assessmentSection) @@ -263,7 +262,8 @@ var secondCalculationGroup = (CalculationGroup) failureMechanism.CalculationsGroup.Children[1]; Assert.AreEqual(0, secondCalculationGroup.Children.Count); - Assert.IsInstanceOf>(failureMechanism.CalculationsGroup.Children[2]); + var calculationWithoutOutput = (StructuresCalculation)failureMechanism.CalculationsGroup.Children[2]; + Assert.IsFalse(calculationWithoutOutput.HasOutput); HeightStructuresFailureMechanismSectionResult firstSectionResult = failureMechanism.SectionResults.First(); Assert.AreSame(calculationWithOutput, firstSectionResult.Calculation); @@ -286,7 +286,8 @@ var secondCalculationGroup = (CalculationGroup)failureMechanism.CalculationsGroup.Children[1]; Assert.AreEqual(0, secondCalculationGroup.Children.Count); - Assert.IsInstanceOf>(failureMechanism.CalculationsGroup.Children[2]); + var calculationWithoutOutput = (StructuresCalculation)failureMechanism.CalculationsGroup.Children[2]; + Assert.IsFalse(calculationWithoutOutput.HasOutput); ClosingStructuresFailureMechanismSectionResult firstSectionResult = failureMechanism.SectionResults.First(); Assert.AreSame(calculationWithOutput, firstSectionResult.Calculation); @@ -304,12 +305,14 @@ var firstCalculationGroup = (CalculationGroup)failureMechanism.CalculationsGroup.Children[0]; Assert.AreEqual(1, firstCalculationGroup.Children.Count); - var calculation = (StructuresCalculation)firstCalculationGroup.Children[0]; - Assert.AreEqual("Calculation 1", calculation.Name); + var calculationWithOutput = (StructuresCalculation)firstCalculationGroup.Children[0]; + Assert.AreEqual("Calculation 1", calculationWithOutput.Name); + Assert.IsTrue(calculationWithOutput.HasOutput); var secondCalculationGroup = (CalculationGroup)failureMechanism.CalculationsGroup.Children[1]; Assert.AreEqual(0, secondCalculationGroup.Children.Count); - Assert.IsInstanceOf>(failureMechanism.CalculationsGroup.Children[2]); + var calculationWithoutOutput = (StructuresCalculation)failureMechanism.CalculationsGroup.Children[2]; + Assert.IsFalse(calculationWithoutOutput.HasOutput); } } } \ No newline at end of file Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -r3e7db9d95e07d438ec99f8488ec184848655b98c -r3992a077683baeefad7b74e04ed498e18e953c6a --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 3e7db9d95e07d438ec99f8488ec184848655b98c) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 3992a077683baeefad7b74e04ed498e18e953c6a) @@ -270,16 +270,6 @@ } } - private static void SetSectionResults(IEnumerable sectionResults) - { - var random = new Random(21); - foreach (var sectionResult in sectionResults) - { - sectionResult.AssessmentLayerOne = random.NextBoolean(); - sectionResult.AssessmentLayerThree = (RoundedDouble) random.NextDouble(); - } - } - private static void AddSections(IFailureMechanism failureMechanism) { failureMechanism.AddSection(new FailureMechanismSection("section 1", new[] @@ -500,7 +490,8 @@ }, ForeshoreProfile = foreshoreProfile, HydraulicBoundaryLocation = hydroLocation - } + }, + Output = new ProbabilityAssessmentOutput(0.7, 0.85, 0.9, 0.10, 0.11) } } }); @@ -511,6 +502,16 @@ failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); } + private static void SetSectionResults(IEnumerable sectionResults) + { + var random = new Random(21); + foreach (var sectionResult in sectionResults) + { + sectionResult.AssessmentLayerOne = random.NextBoolean(); + sectionResult.AssessmentLayerThree = (RoundedDouble) random.NextDouble(); + } + } + #endregion #region ClosingStructures FailureMechanism