Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/AssessmentSectionExtensionsTest.cs
===================================================================
diff -u -r3498b00cbb08beddf6f6e9e60ff432ab708fb3b6 -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/AssessmentSectionExtensionsTest.cs (.../AssessmentSectionExtensionsTest.cs) (revision 3498b00cbb08beddf6f6e9e60ff432ab708fb3b6)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/AssessmentSectionExtensionsTest.cs (.../AssessmentSectionExtensionsTest.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -210,7 +210,7 @@
}
[Test]
- [TestCaseSource(nameof(DifferentCategoryTypes))]
+ [TestCaseSource(typeof(AssessmentSectionHelper), nameof(AssessmentSectionHelper.GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType))]
public void GetAssessmentLevel_HydraulicBoundaryLocationWithOutput_ReturnsCorrespondingAssessmentLevel(
IAssessmentSection assessmentSection,
HydraulicBoundaryLocation hydraulicBoundaryLocation,
@@ -248,44 +248,5 @@
assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
).SetName("LowerLimitNorm");
}
-
- private static IEnumerable DifferentCategoryTypes()
- {
- var assessmentSection = new AssessmentSectionStub();
- var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
-
- assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
- {
- hydraulicBoundaryLocation
- }, true);
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedSignalingNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedSignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.SignalingNorm,
- assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
- ).SetName("SignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.LowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("LowerLimitNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedLowerLimitNorm");
- }
}
}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs
===================================================================
diff -u -rb6c5a6803f86609b579a26f76efebe2ed658d829 -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs (.../AssessmentSectionHelper.cs) (revision b6c5a6803f86609b579a26f76efebe2ed658d829)
+++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/AssessmentSectionHelper.cs (.../AssessmentSectionHelper.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -20,9 +20,11 @@
// All rights reserved.
using System;
+using System.Collections;
using System.Linq;
using Core.Common.Base.Data;
using Core.Common.TestUtil;
+using NUnit.Framework;
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.Contribution;
@@ -91,6 +93,58 @@
return testNormativeAssessmentLevel;
}
+ ///
+ /// Gets a collection of containing an assessment level
+ /// configuration for all types of .
+ ///
+ /// A collection of , in which each item contains:
+ ///
+ /// - the configured assessment section;
+ /// - the hydraulic boundary location for which the assessment level output has been set;
+ /// - the category type at stake;
+ /// - the set assessment level (which makes it the "expected assessment level" given the combination
+ /// of the before-mentioned assessment section, hydraulic boundary location and category type).
+ ///
+ ///
+ public static IEnumerable GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType()
+ {
+ var assessmentSection = new AssessmentSectionStub();
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
+
+ assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
+ {
+ hydraulicBoundaryLocation
+ }, true);
+
+ yield return new TestCaseData(
+ assessmentSection,
+ hydraulicBoundaryLocation,
+ AssessmentSectionCategoryType.FactorizedSignalingNorm,
+ assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
+ ).SetName("FactorizedSignalingNorm");
+
+ yield return new TestCaseData(
+ assessmentSection,
+ hydraulicBoundaryLocation,
+ AssessmentSectionCategoryType.SignalingNorm,
+ assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
+ ).SetName("SignalingNorm");
+
+ yield return new TestCaseData(
+ assessmentSection,
+ hydraulicBoundaryLocation,
+ AssessmentSectionCategoryType.LowerLimitNorm,
+ assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
+ ).SetName("LowerLimitNorm");
+
+ yield return new TestCaseData(
+ assessmentSection,
+ hydraulicBoundaryLocation,
+ AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
+ assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
+ ).SetName("FactorizedLowerLimitNorm");
+ }
+
private static IFailureMechanism[] GetFailureMechanisms(IFailureMechanism failureMechanism)
{
return failureMechanism == null
Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverWaveConditionsInputContextPropertyInfoTest.cs
===================================================================
diff -u -re7e455ded8ce63d7d6694009d2b6d71d6e233bdf -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverWaveConditionsInputContextPropertyInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputContextPropertyInfoTest.cs) (revision e7e455ded8ce63d7d6694009d2b6d71d6e233bdf)
+++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/PropertyInfos/StabilityStoneCoverWaveConditionsInputContextPropertyInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputContextPropertyInfoTest.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System.Collections;
using System.Linq;
using Core.Common.Base.Data;
using Core.Common.Gui.Plugin;
@@ -54,7 +53,7 @@
}
[Test]
- [TestCaseSource(nameof(DifferentCategoryTypes))]
+ [TestCaseSource(typeof(AssessmentSectionHelper), nameof(AssessmentSectionHelper.GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType))]
public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ExpectedProperties(
IAssessmentSection assessmentSection,
HydraulicBoundaryLocation hydraulicBoundaryLocation,
@@ -95,44 +94,5 @@
{
return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverWaveConditionsInputContext));
}
-
- private static IEnumerable DifferentCategoryTypes()
- {
- var assessmentSection = new AssessmentSectionStub();
- var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
-
- assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
- {
- hydraulicBoundaryLocation
- }, true);
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedSignalingNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedSignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.SignalingNorm,
- assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
- ).SetName("SignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.LowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("LowerLimitNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedLowerLimitNorm");
- }
}
}
\ No newline at end of file
Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs
===================================================================
diff -u -rd16723db8548660eb4586fe7fbd7d8e48c695735 -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision d16723db8548660eb4586fe7fbd7d8e48c695735)
+++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverWaveConditionsInputViewInfoTest.cs (.../StabilityStoneCoverWaveConditionsInputViewInfoTest.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System.Collections;
using System.Drawing;
using System.Linq;
using Core.Common.Base.Data;
@@ -138,7 +137,7 @@
}
[Test]
- [TestCaseSource(nameof(DifferentCategoryTypes))]
+ [TestCaseSource(typeof(AssessmentSectionHelper), nameof(AssessmentSectionHelper.GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType))]
public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ReturnViewWithCorrespondingAssessmentLevel(
IAssessmentSection assessmentSection,
HydraulicBoundaryLocation hydraulicBoundaryLocation,
@@ -171,45 +170,6 @@
Assert.AreEqual(expectedAssessmentLevel, designWaterLevelChartData.Points.First().Y);
}
- private static IEnumerable DifferentCategoryTypes()
- {
- var assessmentSection = new AssessmentSectionStub();
- var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
-
- assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
- {
- hydraulicBoundaryLocation
- }, true);
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedSignalingNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedSignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.SignalingNorm,
- assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
- ).SetName("SignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.LowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("LowerLimitNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedLowerLimitNorm");
- }
-
#region ShouldCloseViewWithCalculationDataTester
protected override bool ShouldCloseMethod(IView view, object o)
Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverWaveConditionsInputContextPropertyInfoTest.cs
===================================================================
diff -u -re7e455ded8ce63d7d6694009d2b6d71d6e233bdf -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverWaveConditionsInputContextPropertyInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputContextPropertyInfoTest.cs) (revision e7e455ded8ce63d7d6694009d2b6d71d6e233bdf)
+++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/WaveImpactAsphaltCoverWaveConditionsInputContextPropertyInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputContextPropertyInfoTest.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System.Collections;
using System.Linq;
using Core.Common.Base.Data;
using Core.Common.Gui.Plugin;
@@ -54,7 +53,7 @@
}
[Test]
- [TestCaseSource(nameof(DifferentCategoryTypes))]
+ [TestCaseSource(typeof(AssessmentSectionHelper), nameof(AssessmentSectionHelper.GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType))]
public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ExpectedProperties(
IAssessmentSection assessmentSection,
HydraulicBoundaryLocation hydraulicBoundaryLocation,
@@ -95,44 +94,5 @@
{
return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverWaveConditionsInputContext));
}
-
- private static IEnumerable DifferentCategoryTypes()
- {
- var assessmentSection = new AssessmentSectionStub();
- var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
-
- assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
- {
- hydraulicBoundaryLocation
- }, true);
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedSignalingNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedSignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.SignalingNorm,
- assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
- ).SetName("SignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.LowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("LowerLimitNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedLowerLimitNorm");
- }
}
}
\ No newline at end of file
Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs
===================================================================
diff -u -rd6316e6823d8fe43a41b303d1b75c8323d7a4272 -r1a6b52d906627a8e50b6675c1bbdee644854b959
--- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision d6316e6823d8fe43a41b303d1b75c8323d7a4272)
+++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsInputViewInfoTest.cs) (revision 1a6b52d906627a8e50b6675c1bbdee644854b959)
@@ -138,7 +138,7 @@
}
[Test]
- [TestCaseSource(nameof(DifferentCategoryTypes))]
+ [TestCaseSource(typeof(AssessmentSectionHelper), nameof(AssessmentSectionHelper.GetAssessmentLevelConfigurationPerAssessmentSectionCategoryType))]
public void CreateInstance_WithContextThatHasInputWithSpecificCategoryType_ReturnViewWithCorrespondingAssessmentLevel(
IAssessmentSection assessmentSection,
HydraulicBoundaryLocation hydraulicBoundaryLocation,
@@ -171,45 +171,6 @@
Assert.AreEqual(expectedAssessmentLevel, designWaterLevelChartData.Points.First().Y);
}
- private static IEnumerable DifferentCategoryTypes()
- {
- var assessmentSection = new AssessmentSectionStub();
- var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
-
- assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
- {
- hydraulicBoundaryLocation
- }, true);
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedSignalingNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedSignalingNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedSignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.SignalingNorm,
- assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output.Result
- ).SetName("SignalingNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.LowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("LowerLimitNorm");
-
- yield return new TestCaseData(
- assessmentSection,
- hydraulicBoundaryLocation,
- AssessmentSectionCategoryType.FactorizedLowerLimitNorm,
- assessmentSection.WaterLevelCalculationsForFactorizedLowerLimitNorm.ElementAt(0).Output.Result
- ).SetName("FactorizedLowerLimitNorm");
- }
-
#region ShouldCloseViewWithCalculationDataTester
protected override bool ShouldCloseMethod(IView view, object o)