Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs =================================================================== diff -u -r2e3c50c06378328b265871e73a111c914002dd38 -rce9f350f2e89e398b59b2f412c12b91f3902659f --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs) (revision 2e3c50c06378328b265871e73a111c914002dd38) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs) (revision ce9f350f2e89e398b59b2f412c12b91f3902659f) @@ -38,7 +38,6 @@ using Rhino.Mocks; using Riskeer.Common.Data; using Riskeer.Common.Data.AssessmentSection; -using Riskeer.Common.Data.FailureMechanism; using Riskeer.Common.Data.Hydraulics; using Riskeer.Common.Data.TestUtil; using Riskeer.Common.Forms.PresentationObjects; @@ -328,7 +327,7 @@ hydraulicBoundaryLocation }); - failureMechanism.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm.ElementAt(0).Output = + assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output = new TestHydraulicBoundaryLocationCalculationOutput(2.0); GrassCoverErosionOutwardsWaveConditionsCalculation calculation = CreateValidCalculation(hydraulicBoundaryLocation); @@ -387,7 +386,7 @@ CalculationServiceTestHelper.AssertCalculationStartMessage(msgs.ElementAt(3)); IEnumerable waterLevels = calculation.InputParameters.GetWaterLevels( - failureMechanism.WaterLevelCalculationsForMechanismSpecificFactorizedSignalingNorm.Single().Output.Result); + assessmentSection.WaterLevelCalculationsForSignalingNorm.Single().Output.Result); Assert.AreEqual(3, waterLevels.Count()); AssertWaveConditionsCalculationMessages(msgs, waterLevels, "golfoploop", 4); AssertWaveConditionsCalculationMessages(msgs, waterLevels, "golfklap", 15); @@ -419,7 +418,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - CategoryType = FailureMechanismCategoryType.MechanismSpecificFactorizedSignalingNorm, + WaterLevelType = WaveConditionsInputWaterLevelType.Signaling, ForeshoreProfile = new TestForeshoreProfile(true) { BreakWater = Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rb0899d90d287d9e53b52b7573a0c0fd66120fa16 -rce9f350f2e89e398b59b2f412c12b91f3902659f --- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision b0899d90d287d9e53b52b7573a0c0fd66120fa16) +++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision ce9f350f2e89e398b59b2f412c12b91f3902659f) @@ -27,13 +27,13 @@ using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Controls.TreeView; +using Core.Common.TestUtil; using Core.Gui; using Core.Gui.Commands; using Core.Gui.ContextMenu; using Core.Gui.Forms.Main; -using Core.Gui.TestUtil.ContextMenu; -using Core.Common.TestUtil; using Core.Gui.TestUtil; +using Core.Gui.TestUtil.ContextMenu; using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; @@ -998,7 +998,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); var random = new Random(21); GrassCoverErosionOutwardsWaveConditionsCalculation calculation = validCalculation @@ -1044,10 +1044,10 @@ { // When ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); + void Call() => validateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); int expectedMessageCount = validCalculation ? 2 : 3; @@ -1077,7 +1077,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); var parent = new CalculationGroup(); GrassCoverErosionOutwardsWaveConditionsCalculation calculation = GetValidCalculation(assessmentSection.HydraulicBoundaryDatabase.Locations.First()); @@ -1112,10 +1112,10 @@ { // When ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); + void Call() => validateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); Assert.AreEqual(2, messages.Length); @@ -1138,7 +1138,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = false; @@ -1177,10 +1177,10 @@ { // When ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); + void Call() => validateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); Assert.AreEqual(2, messages.Length); @@ -1203,7 +1203,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = true; @@ -1242,10 +1242,10 @@ { // When ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); + void Call() => validateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); Assert.AreEqual(2, messages.Length); @@ -1268,7 +1268,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.CanUsePreprocessor = true; assessmentSection.HydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings.UsePreprocessor = true; @@ -1308,10 +1308,10 @@ { // When ToolStripItem validateMenuItem = contextMenu.Items[validateMenuItemIndex]; - Action call = () => validateMenuItem.PerformClick(); + void Call() => validateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); Assert.AreEqual(3, messages.Length); @@ -1501,7 +1501,7 @@ { new TestHydraulicBoundaryLocation() }); - ConfigureFailureMechanismWithHydraulicBoundaryOutput(failureMechanism); + ConfigureAssessmentSectionWithHydraulicBoundaryOutput(assessmentSection); var parent = new CalculationGroup(); GrassCoverErosionOutwardsWaveConditionsCalculation calculation = GetValidCalculation(assessmentSection.HydraulicBoundaryDatabase.Locations.First()); @@ -1555,10 +1555,10 @@ { // When ToolStripItem calculateMenuItem = contextMenu.Items[calculateMenuItemIndex]; - Action call = () => calculateMenuItem.PerformClick(); + void Call() => calculateMenuItem.PerformClick(); // Then - TestHelper.AssertLogMessages(call, logMessages => + TestHelper.AssertLogMessages(Call, logMessages => { string[] messages = logMessages.ToArray(); Assert.AreEqual(28, messages.Length); @@ -1750,7 +1750,7 @@ mocks.VerifyAll(); } - private AssessmentSectionStub CreateAssessmentSection() + private static AssessmentSectionStub CreateAssessmentSection() { var assessmentSection = new AssessmentSectionStub { @@ -1764,10 +1764,9 @@ return assessmentSection; } - private static void ConfigureFailureMechanismWithHydraulicBoundaryOutput(GrassCoverErosionOutwardsFailureMechanism failureMechanism) + private static void ConfigureAssessmentSectionWithHydraulicBoundaryOutput(IAssessmentSection assessmentSection) { - failureMechanism.Contribution = 5; - failureMechanism.WaterLevelCalculationsForMechanismSpecificLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationCalculationOutput(12); + assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationCalculationOutput(12); } private static GrassCoverErosionOutwardsWaveConditionsCalculation GetValidCalculation(HydraulicBoundaryLocation location) @@ -1777,7 +1776,7 @@ InputParameters = { HydraulicBoundaryLocation = location, - CategoryType = FailureMechanismCategoryType.MechanismSpecificLowerLimitNorm, + WaterLevelType = WaveConditionsInputWaterLevelType.LowerLimit, ForeshoreProfile = new TestForeshoreProfile(true), UseForeshore = true, UseBreakWater = true,