Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs =================================================================== diff -u -r4a35dfcba3abf411171c9d6ee9e822c0f1956b78 -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 4a35dfcba3abf411171c9d6ee9e822c0f1956b78) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -130,8 +130,24 @@ Assert.IsTrue(calculations.All(c => c.Output.CalculationConvergence == CalculationConvergence.CalculatedConverged)); } + #region WaveConditions + + private static void AssertFailureMechanismCategoryWaveConditionsInput(FailureMechanismCategoryWaveConditionsInput inputParameters) + { + Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); + Assert.AreEqual(FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm, inputParameters.CategoryType); + } + + private static void AssertAssessmentSectionCategoryWaveConditionsInput(AssessmentSectionCategoryWaveConditionsInput inputParameters) + { + Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); + Assert.AreEqual(AssessmentSectionCategoryType.LowerLimitNorm, inputParameters.CategoryType); + } + #endregion + #endregion + #region FailureMechanisms #region GrassCoverErosionInwardsFailureMechanism @@ -171,7 +187,7 @@ .WaveConditionsCalculationGroup.GetCalculations() .OfType() .First(); - AssertExpectedGrassCoverErosionOutwardsWaveConditionsInput(calculation.InputParameters); + AssertFailureMechanismCategoryWaveConditionsInput(calculation.InputParameters); } private static void AssertHydraulicBoundaryLocationCalculations(GrassCoverErosionOutwardsFailureMechanism failureMechanism, IList hydraulicBoundaryLocations) @@ -228,12 +244,6 @@ AssertHydraulicBoundaryCalculationResult(5.34, calculations, 17); } - private static void AssertExpectedGrassCoverErosionOutwardsWaveConditionsInput(FailureMechanismCategoryWaveConditionsInput inputParameters) - { - Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); - Assert.AreEqual(FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm, inputParameters.CategoryType); - } - #endregion #region HeightStructuresFailureMechanism @@ -554,15 +564,9 @@ .WaveConditionsCalculationGroup.GetCalculations() .OfType() .First(); - AssertExpectedStabilityStoneCoverWaveConditionsInput(calculation.InputParameters); + AssertAssessmentSectionCategoryWaveConditionsInput(calculation.InputParameters); } - private static void AssertExpectedStabilityStoneCoverWaveConditionsInput(AssessmentSectionCategoryWaveConditionsInput inputParameters) - { - Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); - Assert.AreEqual(AssessmentSectionCategoryType.LowerLimitNorm, inputParameters.CategoryType); - } - #endregion #region WaveImpactAsphaltCoverFailureMechanism @@ -574,15 +578,9 @@ .WaveConditionsCalculationGroup.GetCalculations() .OfType() .First(); - AssertExpectedWaveImpactAsphaltCoverWaveConditionsInput(calculation.InputParameters); + AssertAssessmentSectionCategoryWaveConditionsInput(calculation.InputParameters); } - private static void AssertExpectedWaveImpactAsphaltCoverWaveConditionsInput(AssessmentSectionCategoryWaveConditionsInput inputParameters) - { - Assert.AreEqual(1300001, inputParameters.HydraulicBoundaryLocation.Id); - Assert.AreEqual(AssessmentSectionCategoryType.LowerLimitNorm, inputParameters.CategoryType); - } - #endregion #endregion Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/GrassCoverErosionOutwardsWaveConditionsCalculationHelper.cs =================================================================== diff -u -rca7d3c9eddcb3636472cbecdc1088af10211b51a -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/GrassCoverErosionOutwardsWaveConditionsCalculationHelper.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationHelper.cs) (revision ca7d3c9eddcb3636472cbecdc1088af10211b51a) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/GrassCoverErosionOutwardsWaveConditionsCalculationHelper.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationHelper.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -33,7 +33,7 @@ namespace Ringtoets.GrassCoverErosionOutwards.Forms { /// - /// Class holds methods to help views when dealing with . + /// Class that holds methods to help views when dealing with . /// public static class GrassCoverErosionOutwardsWaveConditionsCalculationHelper { @@ -63,12 +63,9 @@ throw new ArgumentNullException(nameof(calculations)); } - foreach (ICalculationBase calculation in locations.Select(location => CreateGrassCoverErosionOutwardsWaveConditionsCalculation(location, - calculations, - normType))) - { - calculations.Add(calculation); - } + calculations.AddRange(locations.Select(location => CreateGrassCoverErosionOutwardsWaveConditionsCalculation(location, + calculations, + normType)).ToArray()); } /// @@ -88,11 +85,9 @@ NormType normType) { string nameBase = hydraulicBoundaryLocation.Name; - string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name); - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation { - Name = name, + Name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name), InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs =================================================================== diff -u -re3ebc9635d55057cb242e9a5b4f650b9c87737a8 -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs (.../WaveConditionsInputHelper.cs) (revision e3ebc9635d55057cb242e9a5b4f650b9c87737a8) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Data/WaveConditionsInputHelper.cs (.../WaveConditionsInputHelper.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -50,7 +50,8 @@ /// Sets the of the /// based on the . /// - /// The to set. + /// The + /// to set the category type for. /// The to set the for. /// Thrown when is null. /// Thrown when is an invalid value. @@ -88,7 +89,8 @@ /// Sets the of the /// based on the . /// - /// The to set. + /// The + /// to set the category type for. /// The to set the for. /// Thrown when is null. /// Thrown when is an invalid value. Index: Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverCalculationConfigurationHelper.cs =================================================================== diff -u -rca7d3c9eddcb3636472cbecdc1088af10211b51a -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverCalculationConfigurationHelper.cs (.../StabilityStoneCoverCalculationConfigurationHelper.cs) (revision ca7d3c9eddcb3636472cbecdc1088af10211b51a) +++ Ringtoets/StabilityStoneCover/src/Ringtoets.StabilityStoneCover.Forms/StabilityStoneCoverCalculationConfigurationHelper.cs (.../StabilityStoneCoverCalculationConfigurationHelper.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -33,7 +33,7 @@ namespace Ringtoets.StabilityStoneCover.Forms { /// - /// Class holds methods to help views when dealing with + /// Class that holds methods to help views when dealing with /// public static class StabilityStoneCoverCalculationConfigurationHelper { @@ -63,12 +63,9 @@ throw new ArgumentNullException(nameof(calculations)); } - foreach (ICalculationBase calculation in locations.Select(location => CreateStabilityStoneCoverWaveConditionsCalculation(location, - calculations, - normType))) - { - calculations.Add(calculation); - } + calculations.AddRange(locations.Select(location => CreateStabilityStoneCoverWaveConditionsCalculation(location, + calculations, + normType)).ToArray()); } /// @@ -88,11 +85,9 @@ NormType normType) { string nameBase = hydraulicBoundaryLocation.Name; - string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name); - var calculation = new StabilityStoneCoverWaveConditionsCalculation { - Name = name, + Name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name), InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rd05654718000a34dc822015a143df7f141afa302 -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision d05654718000a34dc822015a143df7f141afa302) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -1714,11 +1714,10 @@ var failureMechanism = new StabilityStoneCoverFailureMechanism(); failureMechanism.WaveConditionsCalculationGroup.Attach(observer); - var assessmentSection = new AssessmentSectionStub(); var context = new StabilityStoneCoverWaveConditionsCalculationGroupContext(failureMechanism.WaveConditionsCalculationGroup, null, failureMechanism, - assessmentSection); + new AssessmentSectionStub()); using (var treeViewControl = new TreeViewControl()) { Index: Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs =================================================================== diff -u -rca7d3c9eddcb3636472cbecdc1088af10211b51a -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs) (revision ca7d3c9eddcb3636472cbecdc1088af10211b51a) +++ Ringtoets/WaveImpactAsphaltCover/src/Ringtoets.WaveImpactAsphaltCover.Forms/WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -33,7 +33,7 @@ namespace Ringtoets.WaveImpactAsphaltCover.Forms { /// - /// Class holds methods to help views when dealing with + /// Class that holds methods to help views when dealing with /// public static class WaveImpactAsphaltCoverWaveConditionsCalculationConfigurationHelper { @@ -62,12 +62,9 @@ throw new ArgumentNullException(nameof(calculations)); } - foreach (ICalculationBase calculation in locations.Select(location => CreateWaveImpactAsphaltCoverWaveConditionsCalculation(location, - calculations, - normType))) - { - calculations.Add(calculation); - } + calculations.AddRange(locations.Select(location => CreateWaveImpactAsphaltCoverWaveConditionsCalculation(location, + calculations, + normType)).ToArray()); } /// @@ -87,11 +84,9 @@ NormType normType) { string nameBase = hydraulicBoundaryLocation.Name; - string name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name); - var calculation = new WaveImpactAsphaltCoverWaveConditionsCalculation { - Name = name, + Name = NamingHelper.GetUniqueName(calculations, nameBase, c => c.Name), InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rfd6040f4814eeb7d853f0dca5cd9b281028a0147 -r861bcd1d9466ea7a592bf5fbc75595728e9dcee1 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision fd6040f4814eeb7d853f0dca5cd9b281028a0147) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 861bcd1d9466ea7a592bf5fbc75595728e9dcee1) @@ -1722,12 +1722,11 @@ var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); failureMechanism.WaveConditionsCalculationGroup.Attach(observer); - var assessmentSection = new AssessmentSectionStub(); var context = new WaveImpactAsphaltCoverWaveConditionsCalculationGroupContext(failureMechanism.WaveConditionsCalculationGroup, null, failureMechanism, - assessmentSection); + new AssessmentSectionStub()); using (var treeViewControl = new TreeViewControl()) {