Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsFailurePathContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsHydraulicLoadsContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,45 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Data;
+
+namespace Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState
+{
+ ///
+ /// Presentation object for in hydraulic loads state.
+ ///
+ public class GrassCoverErosionOutwardsFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The
+ /// instance wrapped by this context object.
+ /// The assessment section which the failure mechanism belongs to.
+ /// Thrown when any parameter is null.
+ public GrassCoverErosionOutwardsFailureMechanismContext(GrassCoverErosionOutwardsFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ : base(failureMechanism, assessmentSection) {}
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Forms/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContext.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,45 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Data;
+
+namespace Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState
+{
+ ///
+ /// Presentation object for in registration state.
+ ///
+ public class GrassCoverErosionOutwardsFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The
+ /// instance wrapped by this context object.
+ /// The assessment section which the failure mechanism belongs to.
+ /// Thrown when any parameter is null.
+ public GrassCoverErosionOutwardsFailureMechanismContext(GrassCoverErosionOutwardsFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ : base(failureMechanism, assessmentSection) {}
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs
===================================================================
diff -u -r9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b)
+++ Riskeer/GrassCoverErosionOutwards/src/Riskeer.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -59,6 +59,8 @@
using Riskeer.Revetment.Data;
using Riskeer.Revetment.Forms.Views;
using Riskeer.Revetment.Service;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState.GrassCoverErosionOutwardsFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.RegistrationState.GrassCoverErosionOutwardsFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.GrassCoverErosionOutwards.Forms.Views.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismView;
@@ -76,12 +78,12 @@
{
public override IEnumerable GetPropertyInfos()
{
- yield return new PropertyInfo
+ yield return new PropertyInfo
{
CreateInstance = context => new HydraulicLoadsStateFailureMechanismProperties(context.WrappedData)
};
- yield return new PropertyInfo
+ yield return new PropertyInfo
{
CreateInstance = context => new RegistrationStateFailureMechanismProperties(context.WrappedData)
};
@@ -115,13 +117,13 @@
public override IEnumerable GetViewInfos()
{
- yield return new RiskeerViewInfo(() => Gui)
+ yield return new RiskeerViewInfo(() => Gui)
{
GetViewName = (view, context) => context.WrappedData.Name,
CreateInstance = context => new HydraulicLoadsStateFailureMechanismView(context.WrappedData, context.Parent)
};
- yield return new RiskeerViewInfo(() => Gui)
+ yield return new RiskeerViewInfo(() => Gui)
{
GetViewName = (view, context) => context.WrappedData.Name,
AdditionalDataCheck = context => context.WrappedData.InAssembly,
@@ -166,11 +168,11 @@
public override IEnumerable GetTreeNodeInfos()
{
- yield return RiskeerTreeNodeInfoFactory.CreateFailureMechanismStateContextTreeNodeInfo(
+ yield return RiskeerTreeNodeInfoFactory.CreateFailureMechanismStateContextTreeNodeInfo(
HydraulicLoadsChildNodeObjects,
HydraulicLoadsContextMenuStrip);
- yield return RiskeerTreeNodeInfoFactory.CreateFailurePathContextTreeNodeInfo(
+ yield return RiskeerTreeNodeInfoFactory.CreateFailurePathContextTreeNodeInfo(
FailurePathEnabledChildNodeObjects,
FailurePathDisabledChildNodeObjects,
FailurePathEnabledContextMenuStrip,
@@ -319,7 +321,7 @@
#region GrassCoverErosionOutwardsHydraulicLoadsContext TreeNodeInfo
- private static object[] HydraulicLoadsChildNodeObjects(GrassCoverErosionOutwardsHydraulicLoadsContext context)
+ private static object[] HydraulicLoadsChildNodeObjects(HydraulicLoadsStateFailureMechanismContext context)
{
GrassCoverErosionOutwardsFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -342,7 +344,7 @@
};
}
- private ContextMenuStrip HydraulicLoadsContextMenuStrip(GrassCoverErosionOutwardsHydraulicLoadsContext context,
+ private ContextMenuStrip HydraulicLoadsContextMenuStrip(HydraulicLoadsStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -381,7 +383,7 @@
#region GrassCoverErosionOutwardsFailurePathContext TreeNodeInfo
- private static object[] FailurePathEnabledChildNodeObjects(GrassCoverErosionOutwardsFailurePathContext context)
+ private static object[] FailurePathEnabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
GrassCoverErosionOutwardsFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -395,7 +397,7 @@
};
}
- private static object[] FailurePathDisabledChildNodeObjects(GrassCoverErosionOutwardsFailurePathContext context)
+ private static object[] FailurePathDisabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
return new object[]
{
@@ -421,7 +423,7 @@
};
}
- private ContextMenuStrip FailurePathEnabledContextMenuStrip(GrassCoverErosionOutwardsFailurePathContext context,
+ private ContextMenuStrip FailurePathEnabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -438,7 +440,7 @@
.Build();
}
- private ContextMenuStrip FailurePathDisabledContextMenuStrip(GrassCoverErosionOutwardsFailurePathContext context,
+ private ContextMenuStrip FailurePathDisabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -453,7 +455,7 @@
.Build();
}
- private void RemoveAllViewsForItem(GrassCoverErosionOutwardsFailurePathContext context)
+ private void RemoveAllViewsForItem(RegistrationStateFailureMechanismContext context)
{
Gui.ViewCommands.RemoveAllViewsForItem(context);
}
Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsFailurePathContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/GrassCoverErosionOutwardsHydraulicLoadsContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,54 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Data;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
+
+namespace Riskeer.GrassCoverErosionOutwards.Forms.Test.PresentationObjects.HydraulicLoadsState
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+
+ // Call
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(assessmentSection, context.Parent);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Forms.Test/PresentationObjects/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTest.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,54 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Data;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
+
+namespace Riskeer.GrassCoverErosionOutwards.Forms.Test.PresentationObjects.RegistrationState
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+
+ // Call
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(assessmentSection, context.Parent);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs
===================================================================
diff -u -r9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -37,6 +37,8 @@
using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
using Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses;
using Riskeer.Revetment.Forms.Views;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState.GrassCoverErosionOutwardsFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.RegistrationState.GrassCoverErosionOutwardsFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.GrassCoverErosionOutwards.Forms.Views.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismView;
@@ -83,12 +85,12 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(GrassCoverErosionOutwardsHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(GrassCoverErosionOutwardsFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
@@ -124,8 +126,8 @@
// Assert
Assert.AreEqual(8, treeNodeInfos.Length);
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionOutwardsHydraulicLoadsContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionOutwardsFailurePathContext)));
+ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HydraulicLoadsStateFailureMechanismContext)));
+ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(RegistrationStateFailureMechanismContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionOutwardsFailureMechanismSectionResultContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionOutwardsCalculationGroupContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionOutwardsWaveConditionsCalculationContext)));
@@ -149,12 +151,12 @@
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(GrassCoverErosionOutwardsHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(GrassCoverErosionOutwardsFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -r0a988b3667d32fbae19e420aa71038bcc97d3b38 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs) (revision 0a988b3667d32fbae19e420aa71038bcc97d3b38)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.GrassCoverErosionOutwards.Data;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.HydraulicLoadsState;
namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.PropertyInfos.HydraulicLoadsState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsHydraulicLoadsContext), info.DataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new GrassCoverErosionOutwardsPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(GrassCoverErosionOutwardsPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(GrassCoverErosionOutwardsHydraulicLoadsContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(GrassCoverErosionOutwardsFailureMechanismContext));
}
}
}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -r0a988b3667d32fbae19e420aa71038bcc97d3b38 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs) (revision 0a988b3667d32fbae19e420aa71038bcc97d3b38)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/PropertyInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismPropertyInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.GrassCoverErosionOutwards.Data;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
using Riskeer.GrassCoverErosionOutwards.Forms.PropertyClasses.RegistrationState;
namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.PropertyInfos.RegistrationState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailurePathContext), info.DataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsFailurePathContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new GrassCoverErosionOutwardsPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(GrassCoverErosionOutwardsPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(GrassCoverErosionOutwardsFailurePathContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(GrassCoverErosionOutwardsFailureMechanismContext));
}
}
}
\ No newline at end of file
Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsFailurePathContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 0a681eea5c0949690e9a61d735f2f02e8523dc99 refers to a dead (removed) revision in file `Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsHydraulicLoadsContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,428 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using Core.Common.Base.Data;
+using Core.Common.Controls.TreeView;
+using Core.Common.TestUtil;
+using Core.Gui;
+using Core.Gui.ContextMenu;
+using Core.Gui.Forms.Main;
+using Core.Gui.Forms.ViewHost;
+using Core.Gui.TestUtil;
+using Core.Gui.TestUtil.ContextMenu;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Data.Hydraulics;
+using Riskeer.Common.Data.TestUtil;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.Common.Service.TestUtil;
+using Riskeer.GrassCoverErosionOutwards.Data;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
+using Riskeer.HydraRing.Calculation.Calculator.Factory;
+using Riskeer.HydraRing.Calculation.Data.Input;
+using Riskeer.HydraRing.Calculation.TestUtil.Calculator;
+using Riskeer.Revetment.Data;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.TreeNodeInfos.HydraulicLoadsState
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest
+ {
+ private const int contextMenuCalculateAllIndex = 2;
+ private MockRepository mocks;
+ private GrassCoverErosionOutwardsPlugin plugin;
+ private TreeNodeInfo info;
+
+ private static readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Riskeer.Integration.Forms, "HydraulicBoundaryDatabase");
+ private static readonly string validFilePath = Path.Combine(testDataPath, "HRD dutch coast south.sqlite");
+
+ [SetUp]
+ public void SetUp()
+ {
+ mocks = new MockRepository();
+ plugin = new GrassCoverErosionOutwardsPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionOutwardsFailureMechanismContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Assert
+ Assert.IsNotNull(info.Text);
+ Assert.IsNotNull(info.ForeColor);
+ Assert.IsNotNull(info.Image);
+ Assert.IsNotNull(info.ContextMenuStrip);
+ Assert.IsNull(info.EnsureVisibleOnCreate);
+ Assert.IsNull(info.ExpandOnCreate);
+ Assert.IsNotNull(info.ChildNodeObjects);
+ Assert.IsNull(info.CanRename);
+ Assert.IsNull(info.OnNodeRenamed);
+ Assert.IsNull(info.CanRemove);
+ Assert.IsNull(info.OnNodeRemoved);
+ Assert.IsNull(info.CanCheck);
+ Assert.IsNull(info.CheckedState);
+ Assert.IsNull(info.OnNodeChecked);
+ Assert.IsNull(info.CanDrag);
+ Assert.IsNull(info.CanDrop);
+ Assert.IsNull(info.CanInsert);
+ Assert.IsNull(info.OnDrop);
+ }
+
+ [Test]
+ public void Text_WithContext_ReturnName()
+ {
+ // Setup
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Call
+ string nodeText = info.Text(context);
+
+ // Assert
+ Assert.AreEqual(failureMechanism.Name, nodeText);
+ }
+
+ [Test]
+ public void ForeColor_Always_ReturnControlText()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Call
+ Color foreColor = info.ForeColor(null);
+
+ // Assert
+ Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), foreColor);
+ }
+
+ [Test]
+ public void Image_Always_ReturnFailureMechanismIcon()
+ {
+ // Setup
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Call
+ Image icon = info.Image(context);
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismIcon, icon);
+ }
+
+ [Test]
+ public void ChildNodeObjects_WithContext_ReturnChildDataNodes()
+ {
+ // Setup
+ var assessmentSection = new AssessmentSectionStub();
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Call
+ object[] children = info.ChildNodeObjects(context).ToArray();
+
+ // Assert
+ Assert.AreEqual(2, children.Length);
+ var inputsFolder = (CategoryTreeFolder) children[0];
+ Assert.AreEqual("Invoer", inputsFolder.Name);
+ Assert.AreEqual(TreeFolderCategory.Input, inputsFolder.Category);
+
+ Assert.AreEqual(2, inputsFolder.Contents.Count());
+ var foreshoreProfilesContext = (ForeshoreProfilesContext) inputsFolder.Contents.ElementAt(0);
+ Assert.AreSame(failureMechanism.ForeshoreProfiles, foreshoreProfilesContext.WrappedData);
+ Assert.AreSame(failureMechanism, foreshoreProfilesContext.ParentFailureMechanism);
+ Assert.AreSame(assessmentSection, foreshoreProfilesContext.ParentAssessmentSection);
+
+ var calculationsInputComments = (Comment) inputsFolder.Contents.ElementAt(1);
+ Assert.AreSame(failureMechanism.CalculationsInputComments, calculationsInputComments);
+
+ var calculationGroupContext = (GrassCoverErosionOutwardsCalculationGroupContext) children[1];
+ Assert.AreSame(failureMechanism.CalculationsGroup, calculationGroupContext.WrappedData);
+ Assert.IsNull(calculationGroupContext.Parent);
+ Assert.AreSame(failureMechanism, calculationGroupContext.FailureMechanism);
+ Assert.AreSame(assessmentSection, calculationGroupContext.AssessmentSection);
+ }
+
+ [Test]
+ public void ContextMenuStrip_WithContext_CallsContextMenuBuilderMethods()
+ {
+ // Setup
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var assessmentSection = new AssessmentSectionStub();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ var menuBuilder = mocks.StrictMock();
+ using (mocks.Ordered())
+ {
+ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddExpandAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.Build()).Return(null);
+ }
+
+ var gui = mocks.Stub();
+ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ info.ContextMenuStrip(context, null, treeViewControl);
+ }
+
+ // Assert
+ // Assert expectancies are called in TearDown()
+ }
+
+ [Test]
+ public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled()
+ {
+ // Setup
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionOutwardsWaveConditionsCalculation());
+
+ var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase
+ {
+ FilePath = validFilePath
+ };
+ HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(hydraulicBoundaryDatabase);
+
+ var assessmentSection = mocks.Stub();
+ assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase);
+
+ var nodeData = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+ var menuBuilder = new CustomItemsOnlyContextMenuBuilder();
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var gui = mocks.Stub();
+ gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl))
+ {
+ // Assert
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndex,
+ "Alles be&rekenen",
+ "Voer alle berekeningen binnen dit faalmechanisme uit.",
+ RiskeerCommonFormsResources.CalculateAllIcon);
+ }
+ }
+ }
+
+ [Test]
+ public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet()
+ {
+ // Setup
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var assessmentSection = new AssessmentSectionStub();
+
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var gui = mocks.Stub();
+ gui.Stub(g => g.ProjectOpened += null).IgnoreArguments();
+ gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
+ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl))
+ {
+ // Assert
+ ToolStripItem contextMenuItem = contextMenu.Items[contextMenuCalculateAllIndex];
+
+ Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text);
+ StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText);
+ TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image);
+ Assert.IsFalse(contextMenuItem.Enabled);
+ }
+ }
+ }
+
+ [Test]
+ public void GivenValidCalculations_WhenCalculatingAllFromContextMenu_ThenAllCalculationsScheduled()
+ {
+ // Given
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation("Test");
+ var assessmentSection = new AssessmentSectionStub
+ {
+ HydraulicBoundaryDatabase =
+ {
+ FilePath = validFilePath
+ }
+ };
+ assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
+ {
+ hydraulicBoundaryLocation
+ });
+ HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(assessmentSection.HydraulicBoundaryDatabase);
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+
+ assessmentSection.WaterLevelCalculationsForSignalingNorm.ElementAt(0).Output =
+ new TestHydraulicBoundaryLocationCalculationOutput(2.0);
+
+ GrassCoverErosionOutwardsWaveConditionsCalculation calculation = CreateValidCalculation(hydraulicBoundaryLocation);
+ failureMechanism.CalculationsGroup.Children.Add(calculation);
+
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks);
+
+ var gui = mocks.Stub();
+ gui.Stub(g => g.MainWindow).Return(mainWindow);
+ gui.Stub(g => g.ProjectOpened += null).IgnoreArguments();
+ gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
+ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ gui.Stub(g => g.DocumentViewController).Return(mocks.Stub());
+
+ var calculatorFactory = mocks.Stub();
+ var waveConditionsCalculator = new TestWaveConditionsCosineCalculator
+ {
+ Converged = false
+ };
+
+ HydraulicBoundaryCalculationSettings expectedCalculationSettings = HydraulicBoundaryCalculationSettingsFactory.CreateSettings(assessmentSection.HydraulicBoundaryDatabase);
+ calculatorFactory.Expect(cf => cf.CreateWaveConditionsCosineCalculator(Arg.Is.NotNull))
+ .WhenCalled(invocation =>
+ {
+ HydraRingCalculationSettingsTestHelper.AssertHydraRingCalculationSettings(
+ expectedCalculationSettings,
+ (HydraRingCalculationSettings) invocation.Arguments[0]);
+ })
+ .Return(waveConditionsCalculator)
+ .Repeat
+ .Times(6);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+ plugin.Activate();
+
+ using (ContextMenuStrip contextMenuAdapter = info.ContextMenuStrip(context, null, treeViewControl))
+ using (new HydraRingCalculatorFactoryConfig(calculatorFactory))
+ {
+ // When
+ void Call() => contextMenuAdapter.Items[contextMenuCalculateAllIndex].PerformClick();
+
+ // Then
+ TestHelper.AssertLogMessages(Call, messages =>
+ {
+ string[] msgs = messages.ToArray();
+ Assert.AreEqual(28, msgs.Length);
+
+ Assert.AreEqual($"Golfcondities berekenen voor '{calculation.Name}' is gestart.", msgs.ElementAt(0));
+ CalculationServiceTestHelper.AssertValidationStartMessage(msgs.ElementAt(1));
+ CalculationServiceTestHelper.AssertValidationEndMessage(msgs.ElementAt(2));
+ CalculationServiceTestHelper.AssertCalculationStartMessage(msgs.ElementAt(3));
+
+ IEnumerable waterLevels = calculation.InputParameters.GetWaterLevels(
+ assessmentSection.WaterLevelCalculationsForSignalingNorm.Single().Output.Result);
+ Assert.AreEqual(3, waterLevels.Count());
+ AssertWaveConditionsCalculationMessages(msgs, waterLevels, "golfoploop", 4);
+ AssertWaveConditionsCalculationMessages(msgs, waterLevels, "golfklap", 15);
+ CalculationServiceTestHelper.AssertCalculationEndMessage(msgs.ElementAt(26));
+ Assert.AreEqual($"Golfcondities berekenen voor '{calculation.Name}' is gelukt.", msgs.ElementAt(27));
+ });
+ }
+ }
+ }
+
+ private static void AssertWaveConditionsCalculationMessages(string[] logMessages, IEnumerable waterLevels, string calculationType, int index)
+ {
+ Assert.AreEqual($"Berekening voor {calculationType} is gestart.", logMessages[index++]);
+
+ foreach (RoundedDouble waterLevel in waterLevels)
+ {
+ Assert.AreEqual($"Berekening voor waterstand '{waterLevel}' is gestart.", logMessages[index++]);
+ StringAssert.StartsWith("Golfcondities berekening is uitgevoerd op de tijdelijke locatie", logMessages[index++]);
+ Assert.AreEqual($"Berekening voor waterstand '{waterLevel}' is beëindigd.", logMessages[index++]);
+ }
+
+ Assert.AreEqual($"Berekening voor {calculationType} is beëindigd.", logMessages[index]);
+ }
+
+ private static GrassCoverErosionOutwardsWaveConditionsCalculation CreateValidCalculation(HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ {
+ return new GrassCoverErosionOutwardsWaveConditionsCalculation
+ {
+ InputParameters =
+ {
+ HydraulicBoundaryLocation = hydraulicBoundaryLocation,
+ WaterLevelType = WaveConditionsInputWaterLevelType.SignalFloodingProbability,
+ ForeshoreProfile = new TestForeshoreProfile(true)
+ {
+ BreakWater =
+ {
+ Height = new Random(39).NextRoundedDouble()
+ }
+ },
+ UseForeshore = true,
+ UseBreakWater = true,
+ LowerBoundaryRevetment = (RoundedDouble) 1,
+ UpperBoundaryRevetment = (RoundedDouble) 2,
+ LowerBoundaryWaterLevels = (RoundedDouble) 1,
+ UpperBoundaryWaterLevels = (RoundedDouble) 2
+ }
+ };
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest.cs (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -0,0 +1,273 @@
+// Copyright (C) Stichting Deltares 2021. All rights reserved.
+//
+// This file is part of Riskeer.
+//
+// Riskeer is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.Drawing;
+using System.Linq;
+using Core.Common.Controls.TreeView;
+using Core.Common.TestUtil;
+using Core.Gui;
+using Core.Gui.ContextMenu;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Common.Data;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Data.TestUtil;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.Common.Plugin.TestUtil;
+using Riskeer.GrassCoverErosionOutwards.Data;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.TreeNodeInfos.RegistrationState
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsFailureMechanismContextTreeNodeInfoTest
+ {
+ private GrassCoverErosionOutwardsPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void Setup()
+ {
+ plugin = new GrassCoverErosionOutwardsPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionOutwardsFailureMechanismContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Assert
+ Assert.IsNotNull(info.Text);
+ Assert.IsNotNull(info.ForeColor);
+ Assert.IsNotNull(info.Image);
+ Assert.IsNotNull(info.ContextMenuStrip);
+ Assert.IsNull(info.EnsureVisibleOnCreate);
+ Assert.IsNull(info.ExpandOnCreate);
+ Assert.IsNotNull(info.ChildNodeObjects);
+ Assert.IsNull(info.CanRename);
+ Assert.IsNull(info.OnNodeRenamed);
+ Assert.IsNull(info.CanRemove);
+ Assert.IsNull(info.OnNodeRemoved);
+ Assert.IsNull(info.CanCheck);
+ Assert.IsNull(info.CheckedState);
+ Assert.IsNull(info.OnNodeChecked);
+ Assert.IsNull(info.CanDrag);
+ Assert.IsNull(info.CanDrop);
+ Assert.IsNull(info.CanInsert);
+ Assert.IsNull(info.OnDrop);
+ }
+
+ [Test]
+ public void Text_WithContext_ReturnsName()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection);
+
+ // Call
+ string text = info.Text(context);
+
+ // Assert
+ Assert.AreEqual("Grasbekleding erosie buitentalud", text);
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Image_Always_ReturnsFailureMechanismIcon()
+ {
+ // Call
+ Image image = info.Image(null);
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismIcon, image);
+ }
+
+ [Test]
+ public void ChildNodeObjects_FailureMechanismInAssemblyTrue_ReturnChildDataNodes()
+ {
+ // Setup
+ var assessmentSection = new AssessmentSectionStub();
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Call
+ object[] children = info.ChildNodeObjects(context).ToArray();
+
+ // Assert
+ Assert.AreEqual(2, children.Length);
+ var inputsFolder = (CategoryTreeFolder) children[0];
+ Assert.AreEqual("Invoer", inputsFolder.Name);
+ Assert.AreEqual(TreeFolderCategory.Input, inputsFolder.Category);
+
+ Assert.AreEqual(2, inputsFolder.Contents.Count());
+ var failureMechanismSectionsContext = (FailureMechanismSectionsContext) inputsFolder.Contents.ElementAt(0);
+ Assert.AreSame(failureMechanism, failureMechanismSectionsContext.WrappedData);
+ Assert.AreSame(assessmentSection, failureMechanismSectionsContext.AssessmentSection);
+
+ var inAssemblyInputComments = (Comment) inputsFolder.Contents.ElementAt(1);
+ Assert.AreSame(failureMechanism.InAssemblyInputComments, inAssemblyInputComments);
+
+ var outputsFolder = (CategoryTreeFolder) children[1];
+ Assert.AreEqual("Oordeel", outputsFolder.Name);
+ Assert.AreEqual(TreeFolderCategory.Output, outputsFolder.Category);
+
+ Assert.AreEqual(2, outputsFolder.Contents.Count());
+
+ var failureMechanismResultsContext = (GrassCoverErosionOutwardsFailureMechanismSectionResultContext)
+ outputsFolder.Contents.ElementAt(0);
+ Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism);
+ Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData);
+
+ var inAssemblyOutputComments = (Comment) outputsFolder.Contents.ElementAt(1);
+ Assert.AreSame(failureMechanism.InAssemblyOutputComments, inAssemblyOutputComments);
+ }
+
+ [Test]
+ public void ChildNodeObjects_FailureMechanismInAssemblyFalse_ReturnChildDataNodes()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Call
+ object[] children = info.ChildNodeObjects(context).ToArray();
+
+ // Assert
+ Assert.AreEqual(1, children.Length);
+
+ var comment = (Comment) children[0];
+ Assert.AreSame(failureMechanism.NotInAssemblyComments, comment);
+
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void ContextMenuStrip_FailureMechanismInAssemblyTrue_CallsContextMenuBuilderMethods()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ var menuBuilder = mocks.StrictMock();
+ using (mocks.Ordered())
+ {
+ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddExpandAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.Build()).Return(null);
+ }
+
+ var gui = mocks.Stub();
+ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ info.ContextMenuStrip(context, null, treeViewControl);
+ }
+
+ // Assert
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void ContextMenuStrip_FailureMechanismInAssemblyFalse_CallsContextMenuBuilderMethods()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+
+ var menuBuilder = mocks.StrictMock();
+ using (mocks.Ordered())
+ {
+ menuBuilder.Expect(mb => mb.AddCustomItem(null)).IgnoreArguments().Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddCollapseAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddExpandAllItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddSeparator()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.Build()).Return(null);
+ }
+
+ var gui = mocks.Stub();
+ gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ info.ContextMenuStrip(context, null, treeViewControl);
+ }
+
+ // Assert
+ mocks.VerifyAll();
+ }
+
+ [TestFixture]
+ public class GrassCoverErosionOutwardsFailurePathContextInAssemblyTreeNodeInfoTest :
+ FailurePathInAssemblyTreeNodeInfoTestFixtureBase
+ {
+ public GrassCoverErosionOutwardsFailurePathContextInAssemblyTreeNodeInfoTest() : base(2, 0) {}
+
+ protected override GrassCoverErosionOutwardsFailureMechanismContext CreateFailureMechanismContext(GrassCoverErosionOutwardsFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ {
+ return new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismResultViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/GrassCoverErosionOutwardsFailureMechanismResultViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismResultViewInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -31,6 +31,7 @@
using Riskeer.Common.Forms.Views;
using Riskeer.GrassCoverErosionOutwards.Data;
using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.ViewInfos
{
@@ -234,7 +235,7 @@
mocks.ReplayAll();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsFailurePathContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
using (var view = new NonAdoptableWithProfileProbabilityFailureMechanismResultView(
failureMechanism.SectionResults, failureMechanism, assessmentSection,
@@ -259,7 +260,7 @@
var assessmentSection = mocks.Stub();
mocks.ReplayAll();
- var context = new GrassCoverErosionOutwardsFailurePathContext(
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(
new GrassCoverErosionOutwardsFailureMechanism(), assessmentSection);
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs
===================================================================
diff -u -r9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision 9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/HydraulicLoadsState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.GrassCoverErosionOutwards.Data;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.GrassCoverErosionOutwards.Forms.Views.HydraulicLoadsState;
namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.ViewInfos.HydraulicLoadsState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsHydraulicLoadsContext), info.DataType);
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsHydraulicLoadsContext), info.ViewDataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -84,7 +84,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (GrassCoverErosionOutwardsFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs
===================================================================
diff -u -r9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision 9f9170f3212fc97c50e3d50d443f52b0bb2b7d1b)
+++ Riskeer/GrassCoverErosionOutwards/test/Riskeer.GrassCoverErosionOutwards.Plugin.Test/ViewInfos/RegistrationState/GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs (.../GrassCoverErosionOutwardsFailureMechanismViewInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.GrassCoverErosionOutwards.Data;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
using Riskeer.GrassCoverErosionOutwards.Forms.Views.RegistrationState;
namespace Riskeer.GrassCoverErosionOutwards.Plugin.Test.ViewInfos.RegistrationState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailurePathContext), info.DataType);
- Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailurePathContext), info.ViewDataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(GrassCoverErosionOutwardsFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsFailurePathContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -91,7 +91,7 @@
InAssembly = inAssembly
};
- var context = new GrassCoverErosionOutwardsFailurePathContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
// Call
bool result = info.AdditionalDataCheck(context);
@@ -108,7 +108,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism();
- var context = new GrassCoverErosionOutwardsFailurePathContext(failureMechanism, assessmentSection);
+ var context = new GrassCoverErosionOutwardsFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (GrassCoverErosionOutwardsFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs
===================================================================
diff -u -rfed9733b56393f58871b000d6c8439dd2fd06178 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision fed9733b56393f58871b000d6c8439dd2fd06178)
+++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -71,7 +71,6 @@
using Riskeer.Common.Util.Helpers;
using Riskeer.Common.Util.TypeConverters;
using Riskeer.DuneErosion.Plugin.Handlers;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
using Riskeer.HeightStructures.Forms.PresentationObjects;
using Riskeer.Integration.Data;
using Riskeer.Integration.Data.StandAlone;
@@ -104,6 +103,8 @@
using FontFamily = System.Windows.Media.FontFamily;
using GrassCoverErosionInwardsCalculationsStateFailureMechanismContext = Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects.CalculationsState.GrassCoverErosionInwardsFailureMechanismContext;
using GrassCoverErosionInwardsRegistrationStateFailureMechanismContext = Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects.RegistrationState.GrassCoverErosionInwardsFailureMechanismContext;
+using GrassCoverErosionOutwardsHydraulicLoadsStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState.GrassCoverErosionOutwardsFailureMechanismContext;
+using GrassCoverErosionOutwardsRegistrationStateFailureMechanismContext = Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState.GrassCoverErosionOutwardsFailureMechanismContext;
using RiskeerCommonDataResources = Riskeer.Common.Data.Properties.Resources;
using RiskeerCommonIOResources = Riskeer.Common.IO.Properties.Resources;
using RiskeerCommonUtilResources = Riskeer.Common.Util.Properties.Resources;
@@ -1731,7 +1732,7 @@
new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection),
new StabilityStoneCoverHydraulicLoadsContext(assessmentSection.StabilityStoneCover, assessmentSection),
new WaveImpactAsphaltCoverHydraulicLoadsContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
- new GrassCoverErosionOutwardsHydraulicLoadsContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
+ new GrassCoverErosionOutwardsHydraulicLoadsStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
new DuneErosionHydraulicLoadsStateFailureMechanismContext(assessmentSection.DuneErosion, assessmentSection)
};
}
@@ -1860,7 +1861,7 @@
new StabilityStoneCoverFailurePathContext(assessmentSection.StabilityStoneCover, assessmentSection),
new WaveImpactAsphaltCoverFailurePathContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
new WaterPressureAsphaltCoverFailurePathContext(assessmentSection.WaterPressureAsphaltCover, assessmentSection),
- new GrassCoverErosionOutwardsFailurePathContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
+ new GrassCoverErosionOutwardsRegistrationStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
new GrassCoverSlipOffOutwardsFailurePathContext(assessmentSection.GrassCoverSlipOffOutwards, assessmentSection),
new GrassCoverSlipOffInwardsFailurePathContext(assessmentSection.GrassCoverSlipOffInwards, assessmentSection),
new HeightStructuresFailurePathContext(assessmentSection.HeightStructures, assessmentSection),
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs
===================================================================
diff -u -rfed9733b56393f58871b000d6c8439dd2fd06178 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision fed9733b56393f58871b000d6c8439dd2fd06178)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -32,7 +32,7 @@
using Riskeer.Common.Plugin.TestUtil;
using Riskeer.DuneErosion.Forms.PresentationObjects.RegistrationState;
using Riskeer.GrassCoverErosionInwards.Forms.PresentationObjects.RegistrationState;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.RegistrationState;
using Riskeer.HeightStructures.Forms.PresentationObjects;
using Riskeer.Integration.Data;
using Riskeer.Integration.Forms.PresentationObjects;
@@ -204,9 +204,9 @@
Assert.AreSame(assessmentSection.WaterPressureAsphaltCover, waterPressureAsphaltCoverFailurePathContext.WrappedData);
Assert.AreSame(assessmentSection, waterPressureAsphaltCoverFailurePathContext.Parent);
- var grassCoverErosionOutwardsFailurePathContext = (GrassCoverErosionOutwardsFailurePathContext) objects[7];
- Assert.AreSame(assessmentSection.GrassCoverErosionOutwards, grassCoverErosionOutwardsFailurePathContext.WrappedData);
- Assert.AreSame(assessmentSection, grassCoverErosionOutwardsFailurePathContext.Parent);
+ var grassCoverErosionOutwardsFailureMechanismContext = (GrassCoverErosionOutwardsFailureMechanismContext) objects[7];
+ Assert.AreSame(assessmentSection.GrassCoverErosionOutwards, grassCoverErosionOutwardsFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, grassCoverErosionOutwardsFailureMechanismContext.Parent);
var grassCoverSlipOffOutwardsFailurePathContext = (GrassCoverSlipOffOutwardsFailurePathContext) objects[8];
Assert.AreSame(assessmentSection.GrassCoverSlipOffOutwards, grassCoverSlipOffOutwardsFailurePathContext.WrappedData);
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs
===================================================================
diff -u -r3eed04fa70b3194af3c7ba4fd7aa1dc323f39218 -r0a681eea5c0949690e9a61d735f2f02e8523dc99
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 3eed04fa70b3194af3c7ba4fd7aa1dc323f39218)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
@@ -35,7 +35,7 @@
using Riskeer.Common.Data.TestUtil;
using Riskeer.Common.Plugin.TestUtil;
using Riskeer.DuneErosion.Forms.PresentationObjects.HydraulicLoadsState;
-using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.Integration.Data;
using Riskeer.Integration.Forms.PresentationObjects;
using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
@@ -179,9 +179,9 @@
Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverHydraulicLoadsContext.WrappedData);
Assert.AreSame(assessmentSection, waveImpactAsphaltCoverHydraulicLoadsContext.Parent);
- var grassCoverErosionOutwardsHydraulicLoadsContext = (GrassCoverErosionOutwardsHydraulicLoadsContext) objects[3];
- Assert.AreSame(assessmentSection.GrassCoverErosionOutwards, grassCoverErosionOutwardsHydraulicLoadsContext.WrappedData);
- Assert.AreSame(assessmentSection, grassCoverErosionOutwardsHydraulicLoadsContext.Parent);
+ var grassCoverErosionOutwardsFailureMechanismContext = (GrassCoverErosionOutwardsFailureMechanismContext) objects[3];
+ Assert.AreSame(assessmentSection.GrassCoverErosionOutwards, grassCoverErosionOutwardsFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, grassCoverErosionOutwardsFailureMechanismContext.Parent);
var duneErosionFailureMechanismContext = (DuneErosionFailureMechanismContext) objects[4];
Assert.AreSame(assessmentSection.DuneErosion, duneErosionFailureMechanismContext.WrappedData);