Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs
===================================================================
diff -u -r3718db599f50e4e68dda3fe51b2541c17b44367b -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 3718db599f50e4e68dda3fe51b2541c17b44367b)
+++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -89,7 +89,6 @@
using Riskeer.Integration.Plugin.Properties;
using Riskeer.Integration.Service;
using Riskeer.Integration.Service.Comparers;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
using ClosingStructuresCalculationsStateFailureMechanismContext = Riskeer.ClosingStructures.Forms.PresentationObjects.CalculationsState.ClosingStructuresFailureMechanismContext;
using ClosingStructuresRegistrationStateFailureMechanismContext = Riskeer.ClosingStructures.Forms.PresentationObjects.RegistrationState.ClosingStructuresFailureMechanismContext;
@@ -109,6 +108,8 @@
using PipingRegistrationStateFailureMechanismContext = Riskeer.Piping.Forms.PresentationObjects.RegistrationState.PipingFailureMechanismContext;
using StabilityPointStructuresCalculationsStateFailureMechanismContext = Riskeer.StabilityPointStructures.Forms.PresentationObjects.CalculationsState.StabilityPointStructuresFailureMechanismContext;
using StabilityPointStructuresRegistrationStateFailureMechanismContext = Riskeer.StabilityPointStructures.Forms.PresentationObjects.RegistrationState.StabilityPointStructuresFailureMechanismContext;
+using StabilityStoneCoverHydraulicLoadsStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState.StabilityStoneCoverFailureMechanismContext;
+using StabilityStoneCoverRegistrationStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState.StabilityStoneCoverFailureMechanismContext;
using RiskeerCommonDataResources = Riskeer.Common.Data.Properties.Resources;
using RiskeerCommonIOResources = Riskeer.Common.IO.Properties.Resources;
using RiskeerCommonUtilResources = Riskeer.Common.Util.Properties.Resources;
@@ -1734,7 +1735,7 @@
return new object[]
{
new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection),
- new StabilityStoneCoverHydraulicLoadsContext(assessmentSection.StabilityStoneCover, assessmentSection),
+ new StabilityStoneCoverHydraulicLoadsStateFailureMechanismContext(assessmentSection.StabilityStoneCover, assessmentSection),
new WaveImpactAsphaltCoverHydraulicLoadsContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
new GrassCoverErosionOutwardsHydraulicLoadsStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
new DuneErosionHydraulicLoadsStateFailureMechanismContext(assessmentSection.DuneErosion, assessmentSection)
@@ -1862,7 +1863,7 @@
new GrassCoverErosionInwardsRegistrationStateFailureMechanismContext(assessmentSection.GrassCoverErosionInwards, assessmentSection),
new MacroStabilityInwardsRegistrationStateFailureMechanismContext(assessmentSection.MacroStabilityInwards, assessmentSection),
new MicrostabilityFailurePathContext(assessmentSection.Microstability, assessmentSection),
- new StabilityStoneCoverFailurePathContext(assessmentSection.StabilityStoneCover, assessmentSection),
+ new StabilityStoneCoverRegistrationStateFailureMechanismContext(assessmentSection.StabilityStoneCover, assessmentSection),
new WaveImpactAsphaltCoverFailurePathContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
new WaterPressureAsphaltCoverFailurePathContext(assessmentSection.WaterPressureAsphaltCover, assessmentSection),
new GrassCoverErosionOutwardsRegistrationStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs
===================================================================
diff -u -r3718db599f50e4e68dda3fe51b2541c17b44367b -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision 3718db599f50e4e68dda3fe51b2541c17b44367b)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -40,7 +40,7 @@
using Riskeer.MacroStabilityInwards.Forms.PresentationObjects.RegistrationState;
using Riskeer.Piping.Forms.PresentationObjects.RegistrationState;
using Riskeer.StabilityPointStructures.Forms.PresentationObjects.RegistrationState;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
@@ -192,9 +192,9 @@
Assert.AreSame(assessmentSection.Microstability, microStabilityFailurePathContext.WrappedData);
Assert.AreSame(assessmentSection, microStabilityFailurePathContext.Parent);
- var stabilityStoneCoverFailurePathContext = (StabilityStoneCoverFailurePathContext) objects[4];
- Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverFailurePathContext.WrappedData);
- Assert.AreSame(assessmentSection, stabilityStoneCoverFailurePathContext.Parent);
+ var stabilityStoneCoverFailureMechanismContext = (StabilityStoneCoverFailureMechanismContext) objects[4];
+ Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, stabilityStoneCoverFailureMechanismContext.Parent);
var waveImpactAsphaltCoverFailurePathContext = (WaveImpactAsphaltCoverFailurePathContext) objects[5];
Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverFailurePathContext.WrappedData);
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs
===================================================================
diff -u -r0a681eea5c0949690e9a61d735f2f02e8523dc99 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 0a681eea5c0949690e9a61d735f2f02e8523dc99)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -38,7 +38,7 @@
using Riskeer.GrassCoverErosionOutwards.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.Integration.Data;
using Riskeer.Integration.Forms.PresentationObjects;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
using RiskeerIntegrationFormsResources = Riskeer.Integration.Forms.Properties.Resources;
@@ -171,9 +171,9 @@
Assert.AreSame(assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryDatabaseContext.WrappedData);
Assert.AreSame(assessmentSection, hydraulicBoundaryDatabaseContext.AssessmentSection);
- var stabilityStoneCoverHydraulicLoadsContext = (StabilityStoneCoverHydraulicLoadsContext) objects[1];
- Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverHydraulicLoadsContext.WrappedData);
- Assert.AreSame(assessmentSection, stabilityStoneCoverHydraulicLoadsContext.Parent);
+ var stabilityStoneCoverFailureMechanismContext = (StabilityStoneCoverFailureMechanismContext) objects[1];
+ Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, stabilityStoneCoverFailureMechanismContext.Parent);
var waveImpactAsphaltCoverHydraulicLoadsContext = (WaveImpactAsphaltCoverHydraulicLoadsContext) objects[2];
Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverHydraulicLoadsContext.WrappedData);
Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContext.cs (revision 0)
+++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContext.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -0,0 +1,43 @@
+// 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.StabilityStoneCover.Data;
+
+namespace Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState
+{
+ ///
+ /// Presentation object for in the hydraulic loads state.
+ ///
+ public class StabilityStoneCoverFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism.
+ /// The parent of .
+ /// Thrown when any parameter is null.
+ public StabilityStoneCoverFailureMechanismContext(StabilityStoneCoverFailureMechanism wrappedFailureMechanism, IAssessmentSection parent)
+ : base(wrappedFailureMechanism, parent) {}
+ }
+}
\ No newline at end of file
Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContext.cs (revision 0)
+++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContext.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -0,0 +1,43 @@
+// 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.StabilityStoneCover.Data;
+
+namespace Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState
+{
+ ///
+ /// Presentation object for in the registration state.
+ ///
+ public class StabilityStoneCoverFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism.
+ /// The parent of .
+ /// Thrown when any parameter is null.
+ public StabilityStoneCoverFailureMechanismContext(StabilityStoneCoverFailureMechanism wrappedFailureMechanism, IAssessmentSection parent)
+ : base(wrappedFailureMechanism, parent) {}
+ }
+}
\ No newline at end of file
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverFailurePathContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Forms/PresentationObjects/StabilityStoneCoverHydraulicLoadsContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs
===================================================================
diff -u -r9dc12897a31f07deb9c2467b166ef94f48da9794 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 9dc12897a31f07deb9c2467b166ef94f48da9794)
+++ Riskeer/StabilityStoneCover/src/Riskeer.StabilityStoneCover.Plugin/StabilityStoneCoverPlugin.cs (.../StabilityStoneCoverPlugin.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -59,6 +59,8 @@
using Riskeer.StabilityStoneCover.IO.Configurations;
using Riskeer.StabilityStoneCover.IO.Exporters;
using Riskeer.StabilityStoneCover.Service;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState.StabilityStoneCoverFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState.StabilityStoneCoverFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.StabilityStoneCover.Forms.PropertyClasses.HydraulicLoadsState.StabilityStoneCoverFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.StabilityStoneCover.Forms.PropertyClasses.RegistrationState.StabilityStoneCoverFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.StabilityStoneCover.Forms.Views.HydraulicLoadsState.StabilityStoneCoverFailureMechanismView;
@@ -75,11 +77,11 @@
{
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)
};
@@ -98,13 +100,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,
@@ -148,11 +150,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,
@@ -316,7 +318,7 @@
#region StabilityStoneCoverHydraulicLoadsContext TreeNodeInfo
- private static object[] HydraulicLoadsChildNodeObjects(StabilityStoneCoverHydraulicLoadsContext context)
+ private static object[] HydraulicLoadsChildNodeObjects(HydraulicLoadsStateFailureMechanismContext context)
{
StabilityStoneCoverFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -339,7 +341,7 @@
};
}
- private ContextMenuStrip HydraulicLoadsContextMenuStrip(StabilityStoneCoverHydraulicLoadsContext context,
+ private ContextMenuStrip HydraulicLoadsContextMenuStrip(HydraulicLoadsStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -359,12 +361,12 @@
.Build();
}
- private static string EnableValidateAndCalculateMenuItemForFailureMechanism(StabilityStoneCoverHydraulicLoadsContext context)
+ private static string EnableValidateAndCalculateMenuItemForFailureMechanism(HydraulicLoadsStateFailureMechanismContext context)
{
return EnableValidateAndCalculateMenuItem(context.Parent);
}
- private void CalculateAllInFailureMechanism(StabilityStoneCoverHydraulicLoadsContext context)
+ private void CalculateAllInFailureMechanism(HydraulicLoadsStateFailureMechanismContext context)
{
ActivityProgressDialogRunner.Run(
Gui.MainWindow,
@@ -376,7 +378,7 @@
#region StabilityStoneCoverFailurePathContext TreeNodeInfo
- private static object[] FailurePathEnabledChildNodeObjects(StabilityStoneCoverFailurePathContext context)
+ private static object[] FailurePathEnabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
StabilityStoneCoverFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -390,7 +392,7 @@
};
}
- private static object[] FailurePathDisabledChildNodeObjects(StabilityStoneCoverFailurePathContext context)
+ private static object[] FailurePathDisabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
return new object[]
{
@@ -416,7 +418,7 @@
};
}
- private ContextMenuStrip FailurePathEnabledContextMenuStrip(StabilityStoneCoverFailurePathContext context,
+ private ContextMenuStrip FailurePathEnabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -433,7 +435,7 @@
.Build();
}
- private ContextMenuStrip FailurePathDisabledContextMenuStrip(StabilityStoneCoverFailurePathContext context,
+ private ContextMenuStrip FailurePathDisabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -448,7 +450,7 @@
.Build();
}
- private void RemoveAllViewsForItem(StabilityStoneCoverFailurePathContext context)
+ private void RemoveAllViewsForItem(RegistrationStateFailureMechanismContext context)
{
Gui.ViewCommands.RemoveAllViewsForItem(context);
}
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTest.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -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.StabilityStoneCover.Data;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
+
+namespace Riskeer.StabilityStoneCover.Forms.Test.PresentationObjects.HydraulicLoadsState
+{
+ [TestFixture]
+ public class StabilityStoneCoverFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+
+ // Call
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ Assert.AreSame(assessmentSection, context.Parent);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/RegistrationState/StabilityStoneCoverFailureMechanismContextTest.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -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.StabilityStoneCover.Data;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
+
+namespace Riskeer.StabilityStoneCover.Forms.Test.PresentationObjects.RegistrationState
+{
+ [TestFixture]
+ public class StabilityStoneCoverFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+
+ // Call
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ Assert.AreSame(assessmentSection, context.Parent);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverFailurePathContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Forms.Test/PresentationObjects/StabilityStoneCoverHydraulicLoadsContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -rd03b3dddddfc4069823503fedc69c2db0bd08427 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs (.../StabilityStoneCoverFailureMechanismPropertyInfoTest.cs) (revision d03b3dddddfc4069823503fedc69c2db0bd08427)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs (.../StabilityStoneCoverFailureMechanismPropertyInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.StabilityStoneCover.Data;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.StabilityStoneCover.Forms.PropertyClasses.HydraulicLoadsState;
namespace Riskeer.StabilityStoneCover.Plugin.Test.PropertyInfos.HydraulicLoadsState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(StabilityStoneCoverHydraulicLoadsContext), info.DataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new StabilityStoneCoverPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(StabilityStoneCoverPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverHydraulicLoadsContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverFailureMechanismContext));
}
}
}
\ No newline at end of file
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/RegistrationState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -rd03b3dddddfc4069823503fedc69c2db0bd08427 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/RegistrationState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs (.../StabilityStoneCoverFailureMechanismPropertyInfoTest.cs) (revision d03b3dddddfc4069823503fedc69c2db0bd08427)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/PropertyInfos/RegistrationState/StabilityStoneCoverFailureMechanismPropertyInfoTest.cs (.../StabilityStoneCoverFailureMechanismPropertyInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.StabilityStoneCover.Data;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
using Riskeer.StabilityStoneCover.Forms.PropertyClasses.RegistrationState;
namespace Riskeer.StabilityStoneCover.Plugin.Test.PropertyInfos.RegistrationState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(StabilityStoneCoverFailurePathContext), info.DataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new StabilityStoneCoverPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(StabilityStoneCoverPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverFailurePathContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(StabilityStoneCoverFailureMechanismContext));
}
}
}
\ No newline at end of file
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs
===================================================================
diff -u -r9dc12897a31f07deb9c2467b166ef94f48da9794 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision 9dc12897a31f07deb9c2467b166ef94f48da9794)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/StabilityStoneCoverPluginTest.cs (.../StabilityStoneCoverPluginTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -36,6 +36,8 @@
using Riskeer.StabilityStoneCover.Data;
using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
using Riskeer.StabilityStoneCover.Forms.PropertyClasses;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState.StabilityStoneCoverFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState.StabilityStoneCoverFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.StabilityStoneCover.Forms.PropertyClasses.HydraulicLoadsState.StabilityStoneCoverFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.StabilityStoneCover.Forms.PropertyClasses.RegistrationState.StabilityStoneCoverFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.StabilityStoneCover.Forms.Views.HydraulicLoadsState.StabilityStoneCoverFailureMechanismView;
@@ -60,11 +62,11 @@
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(StabilityStoneCoverHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(StabilityStoneCoverFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
@@ -102,12 +104,12 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(StabilityStoneCoverHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(StabilityStoneCoverFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
@@ -143,8 +145,8 @@
// Assert
Assert.AreEqual(8, treeNodeInfos.Length);
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverHydraulicLoadsContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverFailurePathContext)));
+ 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(StabilityStoneCoverCalculationGroupContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(StabilityStoneCoverWaveConditionsCalculationContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyStabilityStoneCoverOutput)));
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -0,0 +1,396 @@
+// 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.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.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.Calculation;
+using Riskeer.Common.Data.Hydraulics;
+using Riskeer.Common.Data.TestUtil;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.Common.Service.TestUtil;
+using Riskeer.HydraRing.Calculation.Calculator.Factory;
+using Riskeer.HydraRing.Calculation.Data.Input;
+using Riskeer.HydraRing.Calculation.TestUtil.Calculator;
+using Riskeer.Revetment.Data;
+using Riskeer.StabilityStoneCover.Data;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.StabilityStoneCover.Plugin.Test.TreeNodeInfos.HydraulicLoadsState
+{
+ [TestFixture]
+ public class StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest
+ {
+ private const int contextMenuCalculateAllIndex = 2;
+
+ private readonly string validFilePath = TestHelper.GetTestDataPath(TestDataPath.Riskeer.Integration.Service, Path.Combine("HydraRingCalculation", "HRD ijsselmeer.sqlite"));
+
+ private MockRepository mocks;
+ private StabilityStoneCoverPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ mocks = new MockRepository();
+ plugin = new StabilityStoneCoverPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(StabilityStoneCoverFailureMechanismContext));
+ }
+
+ [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 StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(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 StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(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 StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(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 profilesContext = (ForeshoreProfilesContext) inputsFolder.Contents.ElementAt(0);
+ Assert.AreSame(failureMechanism.ForeshoreProfiles, profilesContext.WrappedData);
+ Assert.AreSame(failureMechanism, profilesContext.ParentFailureMechanism);
+ Assert.AreSame(assessmentSection, profilesContext.ParentAssessmentSection);
+
+ var calculationsInputComments = (Comment) inputsFolder.Contents.ElementAt(1);
+ Assert.AreSame(failureMechanism.CalculationsInputComments, calculationsInputComments);
+
+ var hydraulicBoundariesCalculationGroup = (StabilityStoneCoverCalculationGroupContext) children[1];
+ Assert.AreSame(failureMechanism.CalculationsGroup, hydraulicBoundariesCalculationGroup.WrappedData);
+ Assert.IsNull(hydraulicBoundariesCalculationGroup.Parent);
+ Assert.AreSame(failureMechanism, hydraulicBoundariesCalculationGroup.FailureMechanism);
+ Assert.AreSame(assessmentSection, hydraulicBoundariesCalculationGroup.AssessmentSection);
+ }
+
+ [Test]
+ public void ContextMenuStrip_WithContext_CallsContextMenuBuilderMethods()
+ {
+ // Setup
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+ var assessmentSection = mocks.Stub();
+ var context = new StabilityStoneCoverFailureMechanismContext(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_WithContext_AddCustomItems()
+ {
+ // Setup
+ using (var treeView = new TreeViewControl())
+ {
+ var assessmentSection = mocks.Stub();
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+ var menuBuilder = new CustomItemsOnlyContextMenuBuilder();
+
+ var gui = mocks.Stub();
+ gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder);
+ gui.Stub(g => g.ProjectOpened += null).IgnoreArguments();
+ gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ using (ContextMenuStrip menu = info.ContextMenuStrip(context, assessmentSection, treeView))
+ {
+ // Assert
+ Assert.AreEqual(8, menu.Items.Count);
+
+ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndex,
+ "Alles be&rekenen",
+ "Er zijn geen berekeningen om uit te voeren.",
+ RiskeerCommonFormsResources.CalculateAllIcon,
+ false);
+ }
+ }
+ }
+
+ [Test]
+ public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_CalculateAllDisabled()
+ {
+ // Setup
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+ failureMechanism.CalculationsGroup.Children.Add(new StabilityStoneCoverWaveConditionsCalculation());
+
+ IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mocks);
+ var nodeData = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ var menuBuilder = new CustomItemsOnlyContextMenuBuilder();
+ var gui = mocks.Stub();
+ gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder);
+ gui.Stub(g => g.MainWindow).Return(mocks.Stub());
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
+ {
+ // Assert
+ ToolStripItem calculateItem = contextMenu.Items[contextMenuCalculateAllIndex];
+ Assert.IsFalse(calculateItem.Enabled);
+ Assert.AreEqual("Er is geen hydraulische belastingendatabase geïmporteerd.", calculateItem.ToolTipText);
+ }
+ }
+ }
+
+ [Test]
+ public void GivenValidCalculations_WhenCalculatingAllFromContextMenu_ThenAllCalculationsScheduled()
+ {
+ // Given
+ var failureMechanism = new StabilityStoneCoverFailureMechanism();
+ IAssessmentSection assessmentSection = CreateAssessmentSectionWithHydraulicBoundaryOutput();
+
+ HydraulicBoundaryLocation hydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First();
+ StabilityStoneCoverWaveConditionsCalculation calculationA = GetValidCalculation(hydraulicBoundaryLocation);
+ StabilityStoneCoverWaveConditionsCalculation calculationB = GetValidCalculation(hydraulicBoundaryLocation);
+ List calculations = failureMechanism.CalculationsGroup.Children;
+ calculations.AddRange(new[]
+ {
+ calculationA,
+ calculationB
+ });
+
+ var nodeData = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ IMainWindow mainWindow = MainWindowTestHelper.CreateMainWindowStub(mocks);
+
+ var gui = mocks.Stub();
+ gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder());
+ gui.Stub(g => g.MainWindow).Return(mainWindow);
+
+ var calculatorFactory = mocks.Stub();
+ calculatorFactory.Expect(cf => cf.CreateWaveConditionsCosineCalculator(Arg.Is.NotNull))
+ .WhenCalled(invocation =>
+ {
+ HydraRingCalculationSettingsTestHelper.AssertHydraRingCalculationSettings(
+ HydraulicBoundaryCalculationSettingsFactory.CreateSettings(assessmentSection.HydraulicBoundaryDatabase),
+ (HydraRingCalculationSettings) invocation.Arguments[0]);
+ })
+ .Return(new TestWaveConditionsCosineCalculator())
+ .Repeat
+ .Times(12);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ using (new HydraRingCalculatorFactoryConfig(calculatorFactory))
+ using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl))
+ {
+ // When
+ contextMenu.Items[contextMenuCalculateAllIndex].PerformClick();
+
+ // Then
+ Assert.AreEqual(3, calculationA.Output.BlocksOutput.Count());
+ Assert.AreEqual(3, calculationA.Output.ColumnsOutput.Count());
+ Assert.AreEqual(3, calculationB.Output.BlocksOutput.Count());
+ Assert.AreEqual(3, calculationB.Output.ColumnsOutput.Count());
+ }
+ }
+ }
+
+ private IAssessmentSection CreateAssessmentSectionWithHydraulicBoundaryOutput()
+ {
+ var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1300001, string.Empty, 0, 0);
+
+ var assessmentSection = new AssessmentSectionStub
+ {
+ HydraulicBoundaryDatabase =
+ {
+ FilePath = validFilePath,
+ Locations =
+ {
+ hydraulicBoundaryLocation
+ }
+ }
+ };
+ HydraulicBoundaryDatabaseTestHelper.SetHydraulicBoundaryLocationConfigurationSettings(assessmentSection.HydraulicBoundaryDatabase);
+
+ assessmentSection.SetHydraulicBoundaryLocationCalculations(new[]
+ {
+ hydraulicBoundaryLocation
+ });
+
+ assessmentSection.WaterLevelCalculationsForLowerLimitNorm.First().Output = new TestHydraulicBoundaryLocationCalculationOutput(9.3);
+
+ return assessmentSection;
+ }
+
+ private static StabilityStoneCoverWaveConditionsCalculation GetValidCalculation(HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ {
+ return new StabilityStoneCoverWaveConditionsCalculation
+ {
+ InputParameters =
+ {
+ HydraulicBoundaryLocation = hydraulicBoundaryLocation,
+ WaterLevelType = WaveConditionsInputWaterLevelType.MaximumAllowableFloodingProbability,
+ ForeshoreProfile = new TestForeshoreProfile(true),
+ UseForeshore = true,
+ UseBreakWater = true,
+ StepSize = WaveConditionsInputStepSize.Half,
+ LowerBoundaryRevetment = (RoundedDouble) 4,
+ UpperBoundaryRevetment = (RoundedDouble) 10,
+ UpperBoundaryWaterLevels = (RoundedDouble) 8,
+ LowerBoundaryWaterLevels = (RoundedDouble) 7.1
+ }
+ };
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/RegistrationState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/RegistrationState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/RegistrationState/StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -0,0 +1,271 @@
+// 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.StabilityStoneCover.Data;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.StabilityStoneCover.Plugin.Test.TreeNodeInfos.RegistrationState
+{
+ [TestFixture]
+ public class StabilityStoneCoverFailureMechanismContextTreeNodeInfoTest
+ {
+ private StabilityStoneCoverPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void Setup()
+ {
+ plugin = new StabilityStoneCoverPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(StabilityStoneCoverFailureMechanismContext));
+ }
+
+ [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 StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection);
+
+ // Call
+ string text = info.Text(context);
+
+ // Assert
+ Assert.AreEqual("Stabiliteit steenzetting", 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 StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(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 = (StabilityStoneCoverFailureMechanismSectionResultContext) 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 StabilityStoneCoverFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new StabilityStoneCoverFailureMechanismContext(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 StabilityStoneCoverFailureMechanism();
+ var context = new StabilityStoneCoverFailureMechanismContext(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 StabilityStoneCoverFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new StabilityStoneCoverFailureMechanismContext(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 StabilityStoneCoverFailurePathContextInAssemblyTreeNodeInfoTest :
+ FailurePathInAssemblyTreeNodeInfoTestFixtureBase
+ {
+ public StabilityStoneCoverFailurePathContextInAssemblyTreeNodeInfoTest() : base(2, 0) {}
+
+ protected override StabilityStoneCoverFailureMechanismContext CreateFailureMechanismContext(StabilityStoneCoverFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ {
+ return new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
+ }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverFailurePathContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 4661d9386b3ce16ab6aa0453417fd371a64b9808 refers to a dead (removed) revision in file `Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverHydraulicLoadsContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismViewInfoTest.cs
===================================================================
diff -u -r9dc12897a31f07deb9c2467b166ef94f48da9794 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision 9dc12897a31f07deb9c2467b166ef94f48da9794)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/HydraulicLoadsState/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.StabilityStoneCover.Data;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.StabilityStoneCover.Forms.Views.HydraulicLoadsState;
namespace Riskeer.StabilityStoneCover.Plugin.Test.ViewInfos.HydraulicLoadsState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(StabilityStoneCoverHydraulicLoadsContext), info.DataType);
- Assert.AreEqual(typeof(StabilityStoneCoverHydraulicLoadsContext), info.ViewDataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -84,7 +84,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (StabilityStoneCoverFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/RegistrationState/StabilityStoneCoverFailureMechanismViewInfoTest.cs
===================================================================
diff -u -r9dc12897a31f07deb9c2467b166ef94f48da9794 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/RegistrationState/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision 9dc12897a31f07deb9c2467b166ef94f48da9794)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/RegistrationState/StabilityStoneCoverFailureMechanismViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismViewInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.StabilityStoneCover.Data;
-using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
using Riskeer.StabilityStoneCover.Forms.Views.RegistrationState;
namespace Riskeer.StabilityStoneCover.Plugin.Test.ViewInfos.RegistrationState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(StabilityStoneCoverFailurePathContext), info.DataType);
- Assert.AreEqual(typeof(StabilityStoneCoverFailurePathContext), info.ViewDataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(StabilityStoneCoverFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -91,7 +91,7 @@
InAssembly = inAssembly
};
- var context = new StabilityStoneCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
bool result = info.AdditionalDataCheck(context);
@@ -108,7 +108,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (StabilityStoneCoverFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -r4661d9386b3ce16ab6aa0453417fd371a64b9808
--- Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismResultViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismResultViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782)
+++ Riskeer/StabilityStoneCover/test/Riskeer.StabilityStoneCover.Plugin.Test/ViewInfos/StabilityStoneCoverFailureMechanismResultViewInfoTest.cs (.../StabilityStoneCoverFailureMechanismResultViewInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
@@ -31,6 +31,7 @@
using Riskeer.Common.Forms.Views;
using Riskeer.StabilityStoneCover.Data;
using Riskeer.StabilityStoneCover.Forms.PresentationObjects;
+using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
namespace Riskeer.StabilityStoneCover.Plugin.Test.ViewInfos
{
@@ -231,7 +232,7 @@
mocks.ReplayAll();
var failureMechanism = new StabilityStoneCoverFailureMechanism();
- var context = new StabilityStoneCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var view = new NonAdoptableWithProfileProbabilityFailureMechanismResultView(
failureMechanism.SectionResults, failureMechanism, assessmentSection,
@@ -256,7 +257,7 @@
var assessmentSection = mocks.Stub();
mocks.ReplayAll();
- var context = new StabilityStoneCoverFailurePathContext(new StabilityStoneCoverFailureMechanism(), assessmentSection);
+ var context = new StabilityStoneCoverFailureMechanismContext(new StabilityStoneCoverFailureMechanism(), assessmentSection);
var failureMechanism = new StabilityStoneCoverFailureMechanism();
using (var view = new NonAdoptableWithProfileProbabilityFailureMechanismResultView(