Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsWaveConditionsCalculationHelperTest.cs =================================================================== diff -u -r1ce98a3d9324790760dfe128fb19aeccaf052a15 -rcfab785127fbc85d91c6bb2f259777e537448630 --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsWaveConditionsCalculationHelperTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationHelperTest.cs) (revision 1ce98a3d9324790760dfe128fb19aeccaf052a15) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/GrassCoverErosionOutwardsWaveConditionsCalculationHelperTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationHelperTest.cs) (revision cfab785127fbc85d91c6bb2f259777e537448630) @@ -26,7 +26,6 @@ using NUnit.Framework; using Riskeer.Common.Data.Calculation; using Riskeer.Common.Data.Contribution; -using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; using Riskeer.GrassCoverErosionOutwards.Data; using Riskeer.Revetment.Data; @@ -44,12 +43,10 @@ var calculations = new List(); // Call - TestDelegate test = () => GrassCoverErosionOutwardsWaveConditionsCalculationHelper.AddCalculationsFromLocations(null, - calculations, - random.NextEnumValue()); + void Call() => GrassCoverErosionOutwardsWaveConditionsCalculationHelper.AddCalculationsFromLocations(null, calculations, random.NextEnumValue()); // Assert - string paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("locations", paramName); } @@ -61,12 +58,10 @@ IEnumerable locations = Enumerable.Empty(); // Call - TestDelegate test = () => GrassCoverErosionOutwardsWaveConditionsCalculationHelper.AddCalculationsFromLocations(locations, - null, - random.NextEnumValue()); + void Call() => GrassCoverErosionOutwardsWaveConditionsCalculationHelper.AddCalculationsFromLocations(locations, null, random.NextEnumValue()); // Assert - string paramName = Assert.Throws(test).ParamName; + string paramName = Assert.Throws(Call).ParamName; Assert.AreEqual("calculations", paramName); } @@ -86,11 +81,11 @@ } [Test] - [TestCase(NormType.LowerLimit, FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm)] - [TestCase(NormType.Signaling, FailureMechanismCategoryType.MechanismSpecificSignalingNorm)] - public void AddCalculationsFromLocations_MultipleLocationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] + [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] + public void AddCalculationsFromLocations_MultipleLocationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, - FailureMechanismCategoryType expectedFailureMechanismCategoryType) + WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) { // Setup const string name = "name"; @@ -110,21 +105,21 @@ Assert.AreEqual(name, firstCalculation.Name); FailureMechanismCategoryWaveConditionsInput firstCalculationInput = firstCalculation.InputParameters; Assert.AreEqual(locations[0], firstCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, firstCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, firstCalculationInput.WaterLevelType); var secondCalculation = (GrassCoverErosionOutwardsWaveConditionsCalculation) calculationBases.ElementAt(1); Assert.AreEqual($"{name} (1)", secondCalculation.Name); FailureMechanismCategoryWaveConditionsInput secondCalculationInput = secondCalculation.InputParameters; Assert.AreSame(locations[1], secondCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, secondCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, secondCalculationInput.WaterLevelType); } [Test] - [TestCase(NormType.LowerLimit, FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm)] - [TestCase(NormType.Signaling, FailureMechanismCategoryType.MechanismSpecificSignalingNorm)] - public void AddCalculationsFromLocations_MultipleLocationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] + [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] + public void AddCalculationsFromLocations_MultipleLocationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, - FailureMechanismCategoryType expectedFailureMechanismCategoryType) + WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) { // Setup const string name = "name"; @@ -150,13 +145,13 @@ Assert.AreEqual($"{name} (1)", firstCalculation.Name); FailureMechanismCategoryWaveConditionsInput firstCalculationInput = firstCalculation.InputParameters; Assert.AreEqual(locations[0], firstCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, firstCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, firstCalculationInput.WaterLevelType); var secondCalculation = (GrassCoverErosionOutwardsWaveConditionsCalculation) calculationBases.ElementAt(2); Assert.AreEqual($"{name} (2)", secondCalculation.Name); FailureMechanismCategoryWaveConditionsInput secondCalculationInput = secondCalculation.InputParameters; Assert.AreSame(locations[1], secondCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, secondCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, secondCalculationInput.WaterLevelType); } } } \ No newline at end of file Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -ra99b93c5ed01e2b8d42a043118eecee3a70942b9 -rcfab785127fbc85d91c6bb2f259777e537448630 --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision a99b93c5ed01e2b8d42a043118eecee3a70942b9) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision cfab785127fbc85d91c6bb2f259777e537448630) @@ -1529,7 +1529,7 @@ Assert.IsNotNull(newCalculationItem); Assert.AreEqual("Nieuwe berekening (1)", newlyAddedItem.Name, "An item with the same name default name already exists, therefore '(1)' needs to be appended."); - Assert.AreEqual(GetCategoryTypeFromNormType(normType), newCalculationItem.InputParameters.CategoryType); + Assert.AreEqual(GetWaterLevelTypeFromNormType(normType), newCalculationItem.InputParameters.WaterLevelType); } } } @@ -1844,18 +1844,18 @@ Assert.NotNull(dialog); Assert.NotNull(grid); - FailureMechanismCategoryType expectedFailureMechanismCategoryType = GetCategoryTypeFromNormType(normType); + WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType = GetWaterLevelTypeFromNormType(normType); var firstCalculation = group.Children[2] as GrassCoverErosionOutwardsWaveConditionsCalculation; Assert.IsNotNull(firstCalculation); FailureMechanismCategoryWaveConditionsInput firstCalculationInput = firstCalculation.InputParameters; Assert.AreSame(hydraulicBoundaryLocation1, firstCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, firstCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, firstCalculationInput.WaterLevelType); var secondCalculation = group.Children[3] as GrassCoverErosionOutwardsWaveConditionsCalculation; Assert.IsNotNull(secondCalculation); FailureMechanismCategoryWaveConditionsInput secondCalculationInput = secondCalculation.InputParameters; Assert.AreSame(hydraulicBoundaryLocation2, secondCalculationInput.HydraulicBoundaryLocation); - Assert.AreEqual(expectedFailureMechanismCategoryType, secondCalculationInput.CategoryType); + Assert.AreEqual(expectedWaveConditionsInputWaterLevelType, secondCalculationInput.WaterLevelType); } } @@ -1971,14 +1971,14 @@ }; } - private static FailureMechanismCategoryType GetCategoryTypeFromNormType(NormType normType) + private static WaveConditionsInputWaterLevelType GetWaterLevelTypeFromNormType(NormType normType) { switch (normType) { case NormType.LowerLimit: - return FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm; + return WaveConditionsInputWaterLevelType.LowerLimit; case NormType.Signaling: - return FailureMechanismCategoryType.MechanismSpecificSignalingNorm; + return WaveConditionsInputWaterLevelType.Signaling; default: throw new NotSupportedException(); } Index: Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs =================================================================== diff -u -r023acb8e66cd1950889e7221138f9abc0f89e17f -rcfab785127fbc85d91c6bb2f259777e537448630 --- Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (.../WaveConditionsInputHelperTest.cs) (revision 023acb8e66cd1950889e7221138f9abc0f89e17f) +++ Riskeer/Revetment/test/Riskeer.Revetment.Data.Test/WaveConditionsInputHelperTest.cs (.../WaveConditionsInputHelperTest.cs) (revision cfab785127fbc85d91c6bb2f259777e537448630) @@ -28,7 +28,6 @@ using NUnit.Framework; using Riskeer.Common.Data.AssessmentSection; using Riskeer.Common.Data.Contribution; -using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; using Riskeer.Common.Data.TestUtil; using Riskeer.Revetment.Data.TestUtil; @@ -131,11 +130,11 @@ } [Test] - [TestCase(NormType.Signaling, FailureMechanismCategoryType.MechanismSpecificSignalingNorm)] - [TestCase(NormType.LowerLimit, FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm)] + [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] + [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] public void SetWaterLevelType_WithFailureMechanismCategoryWaveConditionsInputAndVariousNormTypes_SetsCategoryType( NormType normType, - FailureMechanismCategoryType expectedFailureMechanismCategoryType) + WaveConditionsInputWaterLevelType expectedFailureMechanismCategoryType) { // Setup var waveConditionsInput = new FailureMechanismCategoryWaveConditionsInput(); @@ -144,7 +143,7 @@ WaveConditionsInputHelper.SetWaterLevelType(waveConditionsInput, normType); // Assert - Assert.AreEqual(expectedFailureMechanismCategoryType, waveConditionsInput.CategoryType); + Assert.AreEqual(expectedFailureMechanismCategoryType, waveConditionsInput.WaterLevelType); } [Test] Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/StabilityStoneCoverCalculationConfigurationHelperTest.cs =================================================================== diff -u -r231f9afd49470a9c23f89364b1b5c8ef136c8f0b -rcfab785127fbc85d91c6bb2f259777e537448630 --- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/StabilityStoneCoverCalculationConfigurationHelperTest.cs (.../StabilityStoneCoverCalculationConfigurationHelperTest.cs) (revision 231f9afd49470a9c23f89364b1b5c8ef136c8f0b) +++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/StabilityStoneCoverCalculationConfigurationHelperTest.cs (.../StabilityStoneCoverCalculationConfigurationHelperTest.cs) (revision cfab785127fbc85d91c6bb2f259777e537448630) @@ -83,7 +83,7 @@ [Test] [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] - public void AddCalculationsFromLocations_MultipleCalculationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + public void AddCalculationsFromLocations_MultipleCalculationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) { @@ -117,7 +117,7 @@ [Test] [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] - public void AddCalculationsFromLocations_MultipleCalculationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + public void AddCalculationsFromLocations_MultipleCalculationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) { Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelperTest.cs =================================================================== diff -u -r1ce98a3d9324790760dfe128fb19aeccaf052a15 -rcfab785127fbc85d91c6bb2f259777e537448630 --- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelperTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelperTest.cs) (revision 1ce98a3d9324790760dfe128fb19aeccaf052a15) +++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelperTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelperTest.cs) (revision cfab785127fbc85d91c6bb2f259777e537448630) @@ -89,7 +89,7 @@ [Test] [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] - public void AddCalculationsFromLocations_MultipleCalculationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + public void AddCalculationsFromLocations_MultipleCalculationsEmptyCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) { @@ -125,7 +125,7 @@ [Test] [TestCase(NormType.LowerLimit, WaveConditionsInputWaterLevelType.LowerLimit)] [TestCase(NormType.Signaling, WaveConditionsInputWaterLevelType.Signaling)] - public void AddCalculationsFromLocations_MultipleCalculationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsAndCorrectInputSet( + public void AddCalculationsFromLocations_MultipleCalculationsAndDuplicateNameInCalculationBase_ReturnsUniquelyNamedCalculationsWithCorrectInputSet( NormType normType, WaveConditionsInputWaterLevelType expectedWaveConditionsInputWaterLevelType) {