Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs
===================================================================
diff -u -r4661d9386b3ce16ab6aa0453417fd371a64b9808 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
+++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -89,7 +89,6 @@
using Riskeer.Integration.Plugin.Properties;
using Riskeer.Integration.Service;
using Riskeer.Integration.Service.Comparers;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
using ClosingStructuresCalculationsStateFailureMechanismContext = Riskeer.ClosingStructures.Forms.PresentationObjects.CalculationsState.ClosingStructuresFailureMechanismContext;
using ClosingStructuresRegistrationStateFailureMechanismContext = Riskeer.ClosingStructures.Forms.PresentationObjects.RegistrationState.ClosingStructuresFailureMechanismContext;
using CoreGuiResources = Core.Gui.Properties.Resources;
@@ -106,10 +105,6 @@
using MacroStabilityInwardsRegistrationStateFailureMechanismContext = Riskeer.MacroStabilityInwards.Forms.PresentationObjects.RegistrationState.MacroStabilityInwardsFailureMechanismContext;
using PipingCalculationsStateFailureMechanismContext = Riskeer.Piping.Forms.PresentationObjects.CalculationsState.PipingFailureMechanismContext;
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;
@@ -119,6 +114,12 @@
using RiskeerDataResources = Riskeer.Integration.Data.Properties.Resources;
using RiskeerFormsResources = Riskeer.Integration.Forms.Properties.Resources;
using RiskeerIOResources = Riskeer.Integration.IO.Properties.Resources;
+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 WaveImpactAsphaltCoverHydraulicLoadsStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismContext;
+using WaveImpactAsphaltCoverRegistrationStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState.WaveImpactAsphaltCoverFailureMechanismContext;
namespace Riskeer.Integration.Plugin
{
@@ -1736,7 +1737,7 @@
{
new HydraulicBoundaryDatabaseContext(assessmentSection.HydraulicBoundaryDatabase, assessmentSection),
new StabilityStoneCoverHydraulicLoadsStateFailureMechanismContext(assessmentSection.StabilityStoneCover, assessmentSection),
- new WaveImpactAsphaltCoverHydraulicLoadsContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
+ new WaveImpactAsphaltCoverHydraulicLoadsStateFailureMechanismContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
new GrassCoverErosionOutwardsHydraulicLoadsStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
new DuneErosionHydraulicLoadsStateFailureMechanismContext(assessmentSection.DuneErosion, assessmentSection)
};
@@ -1864,7 +1865,7 @@
new MacroStabilityInwardsRegistrationStateFailureMechanismContext(assessmentSection.MacroStabilityInwards, assessmentSection),
new MicrostabilityFailurePathContext(assessmentSection.Microstability, assessmentSection),
new StabilityStoneCoverRegistrationStateFailureMechanismContext(assessmentSection.StabilityStoneCover, assessmentSection),
- new WaveImpactAsphaltCoverFailurePathContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
+ new WaveImpactAsphaltCoverRegistrationStateFailureMechanismContext(assessmentSection.WaveImpactAsphaltCover, assessmentSection),
new WaterPressureAsphaltCoverFailurePathContext(assessmentSection.WaterPressureAsphaltCover, assessmentSection),
new GrassCoverErosionOutwardsRegistrationStateFailureMechanismContext(assessmentSection.GrassCoverErosionOutwards, assessmentSection),
new GrassCoverSlipOffOutwardsFailurePathContext(assessmentSection.GrassCoverSlipOffOutwards, assessmentSection),
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs
===================================================================
diff -u -r4661d9386b3ce16ab6aa0453417fd371a64b9808 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/GenericFailureMechanismsContextTreeNodeInfoTest.cs (.../GenericFailureMechanismsContextTreeNodeInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -41,7 +41,7 @@
using Riskeer.Piping.Forms.PresentationObjects.RegistrationState;
using Riskeer.StabilityPointStructures.Forms.PresentationObjects.RegistrationState;
using Riskeer.StabilityStoneCover.Forms.PresentationObjects.RegistrationState;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos
@@ -196,9 +196,9 @@
Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverFailureMechanismContext.WrappedData);
Assert.AreSame(assessmentSection, stabilityStoneCoverFailureMechanismContext.Parent);
- var waveImpactAsphaltCoverFailurePathContext = (WaveImpactAsphaltCoverFailurePathContext) objects[5];
- Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverFailurePathContext.WrappedData);
- Assert.AreSame(assessmentSection, waveImpactAsphaltCoverFailurePathContext.Parent);
+ var waveImpactAsphaltCoverFailureMechanismContext = (WaveImpactAsphaltCoverFailureMechanismContext) objects[5];
+ Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, waveImpactAsphaltCoverFailureMechanismContext.Parent);
var waterPressureAsphaltCoverFailurePathContext = (WaterPressureAsphaltCoverFailurePathContext) objects[6];
Assert.AreSame(assessmentSection.WaterPressureAsphaltCover, waterPressureAsphaltCoverFailurePathContext.WrappedData);
Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs
===================================================================
diff -u -r4661d9386b3ce16ab6aa0453417fd371a64b9808 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 4661d9386b3ce16ab6aa0453417fd371a64b9808)
+++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -39,7 +39,7 @@
using Riskeer.Integration.Data;
using Riskeer.Integration.Forms.PresentationObjects;
using Riskeer.StabilityStoneCover.Forms.PresentationObjects.HydraulicLoadsState;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState;
using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
using RiskeerIntegrationFormsResources = Riskeer.Integration.Forms.Properties.Resources;
@@ -175,9 +175,9 @@
Assert.AreSame(assessmentSection.StabilityStoneCover, stabilityStoneCoverFailureMechanismContext.WrappedData);
Assert.AreSame(assessmentSection, stabilityStoneCoverFailureMechanismContext.Parent);
- var waveImpactAsphaltCoverHydraulicLoadsContext = (WaveImpactAsphaltCoverHydraulicLoadsContext) objects[2];
- Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverHydraulicLoadsContext.WrappedData);
- Assert.AreSame(assessmentSection, waveImpactAsphaltCoverHydraulicLoadsContext.Parent);
+ var waveImpactAsphaltCoverFailureMechanismContext = (WaveImpactAsphaltCoverFailureMechanismContext) objects[2];
+ Assert.AreSame(assessmentSection.WaveImpactAsphaltCover, waveImpactAsphaltCoverFailureMechanismContext.WrappedData);
+ Assert.AreSame(assessmentSection, waveImpactAsphaltCoverFailureMechanismContext.Parent);
var grassCoverErosionOutwardsFailureMechanismContext = (GrassCoverErosionOutwardsFailureMechanismContext) objects[3];
Assert.AreSame(assessmentSection.GrassCoverErosionOutwards, grassCoverErosionOutwardsFailureMechanismContext.WrappedData);
Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContext.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContext.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -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.WaveImpactAsphaltCover.Data;
+
+namespace Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState
+{
+ ///
+ /// Presentation object for in the hydraulic loads state.
+ ///
+ public class WaveImpactAsphaltCoverFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism.
+ /// The parent of .
+ /// Thrown when any parameter is null.
+ public WaveImpactAsphaltCoverFailureMechanismContext(WaveImpactAsphaltCoverFailureMechanism wrappedFailureMechanism, IAssessmentSection parent)
+ : base(wrappedFailureMechanism, parent) {}
+ }
+}
\ No newline at end of file
Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContext.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContext.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContext.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -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.WaveImpactAsphaltCover.Data;
+
+namespace Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState
+{
+ ///
+ /// Presentation object for in the registration state.
+ ///
+ public class WaveImpactAsphaltCoverFailureMechanismContext : FailureMechanismContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The failure mechanism.
+ /// The parent of .
+ /// Thrown when any parameter is null.
+ public WaveImpactAsphaltCoverFailureMechanismContext(WaveImpactAsphaltCoverFailureMechanism wrappedFailureMechanism, IAssessmentSection parent)
+ : base(wrappedFailureMechanism, parent) {}
+ }
+}
\ No newline at end of file
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/WaveImpactAsphaltCoverFailurePathContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Forms/PresentationObjects/WaveImpactAsphaltCoverHydraulicLoadsContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs
===================================================================
diff -u -rac7f4c3eecc95a1f469ceb08178b77965742b974 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision ac7f4c3eecc95a1f469ceb08178b77965742b974)
+++ Riskeer/WaveImpactAsphaltCover/src/Riskeer.WaveImpactAsphaltCover.Plugin/WaveImpactAsphaltCoverPlugin.cs (.../WaveImpactAsphaltCoverPlugin.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -59,6 +59,8 @@
using Riskeer.WaveImpactAsphaltCover.IO.Configurations;
using Riskeer.WaveImpactAsphaltCover.IO.Exporters;
using Riskeer.WaveImpactAsphaltCover.Service;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState.WaveImpactAsphaltCoverFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.RegistrationState.WaveImpactAsphaltCoverFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.WaveImpactAsphaltCover.Forms.Views.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismView;
@@ -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, context.Parent)
};
@@ -95,13 +97,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,
@@ -159,11 +161,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,
@@ -317,7 +319,7 @@
#region WaveImpactAsphaltCoverHydraulicLoadsContext TreeNodeInfo
- private static object[] HydraulicLoadsChildNodeObjects(WaveImpactAsphaltCoverHydraulicLoadsContext context)
+ private static object[] HydraulicLoadsChildNodeObjects(HydraulicLoadsStateFailureMechanismContext context)
{
WaveImpactAsphaltCoverFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -340,7 +342,7 @@
};
}
- private ContextMenuStrip HydraulicLoadsContextMenuStrip(WaveImpactAsphaltCoverHydraulicLoadsContext context,
+ private ContextMenuStrip HydraulicLoadsContextMenuStrip(HydraulicLoadsStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -360,12 +362,12 @@
.Build();
}
- private static string EnableValidateAndCalculateMenuItemForFailureMechanism(WaveImpactAsphaltCoverHydraulicLoadsContext context)
+ private static string EnableValidateAndCalculateMenuItemForFailureMechanism(HydraulicLoadsStateFailureMechanismContext context)
{
return EnableValidateAndCalculateMenuItem(context.Parent);
}
- private void CalculateAllInFailureMechanism(WaveImpactAsphaltCoverHydraulicLoadsContext context)
+ private void CalculateAllInFailureMechanism(HydraulicLoadsStateFailureMechanismContext context)
{
ActivityProgressDialogRunner.Run(
Gui.MainWindow,
@@ -377,7 +379,7 @@
#region WaveImpactAsphaltCoverFailurePathContext TreeNodeInfo
- private static object[] FailurePathEnabledChildNodeObjects(WaveImpactAsphaltCoverFailurePathContext context)
+ private static object[] FailurePathEnabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
WaveImpactAsphaltCoverFailureMechanism failureMechanism = context.WrappedData;
IAssessmentSection assessmentSection = context.Parent;
@@ -391,7 +393,7 @@
};
}
- private static object[] FailurePathDisabledChildNodeObjects(WaveImpactAsphaltCoverFailurePathContext context)
+ private static object[] FailurePathDisabledChildNodeObjects(RegistrationStateFailureMechanismContext context)
{
return new object[]
{
@@ -418,7 +420,7 @@
};
}
- private ContextMenuStrip FailurePathEnabledContextMenuStrip(WaveImpactAsphaltCoverFailurePathContext context,
+ private ContextMenuStrip FailurePathEnabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -435,7 +437,7 @@
.Build();
}
- private ContextMenuStrip FailurePathDisabledContextMenuStrip(WaveImpactAsphaltCoverFailurePathContext context,
+ private ContextMenuStrip FailurePathDisabledContextMenuStrip(RegistrationStateFailureMechanismContext context,
object parentData,
TreeViewControl treeViewControl)
{
@@ -450,7 +452,7 @@
.Build();
}
- private void RemoveAllViewsForItem(WaveImpactAsphaltCoverFailurePathContext context)
+ private void RemoveAllViewsForItem(RegistrationStateFailureMechanismContext context)
{
Gui.ViewCommands.RemoveAllViewsForItem(context);
}
@@ -472,7 +474,7 @@
nodeData.FailureMechanism,
nodeData.AssessmentSection));
}
- else if (item is CalculationGroup @group)
+ else if (item is CalculationGroup group)
{
childNodeObjects.Add(new WaveImpactAsphaltCoverCalculationGroupContext(group,
nodeData.WrappedData,
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -0,0 +1,53 @@
+// 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.WaveImpactAsphaltCover.Data;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState;
+
+namespace Riskeer.WaveImpactAsphaltCover.Forms.Test.PresentationObjects.HydraulicLoadsState
+{
+ [TestFixture]
+ public class WaveImpactAsphaltCoverFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
+
+ // Call
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ Assert.AreSame(assessmentSection, context.Parent);
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTest.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -0,0 +1,53 @@
+// 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.WaveImpactAsphaltCover.Data;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
+
+namespace Riskeer.WaveImpactAsphaltCover.Forms.Test.PresentationObjects.RegistrationState
+{
+ [TestFixture]
+ public class WaveImpactAsphaltCoverFailureMechanismContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
+
+ // Call
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(failureMechanism, context.WrappedData);
+ Assert.AreSame(assessmentSection, context.Parent);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/WaveImpactAsphaltCoverFailurePathContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Forms.Test/PresentationObjects/WaveImpactAsphaltCoverHydraulicLoadsContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -r5319a71f64c1faa285332c83df061eb511d93c59 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs) (revision 5319a71f64c1faa285332c83df061eb511d93c59)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.WaveImpactAsphaltCover.Data;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.HydraulicLoadsState;
namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.PropertyInfos.HydraulicLoadsState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverHydraulicLoadsContext), info.DataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new WaveImpactAsphaltCoverPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(WaveImpactAsphaltCoverPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverHydraulicLoadsContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverFailureMechanismContext));
}
}
}
\ No newline at end of file
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs
===================================================================
diff -u -r5319a71f64c1faa285332c83df061eb511d93c59 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs) (revision 5319a71f64c1faa285332c83df061eb511d93c59)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/PropertyInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismPropertyInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -26,7 +26,7 @@
using Rhino.Mocks;
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.WaveImpactAsphaltCover.Data;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
using Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.RegistrationState;
namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.PropertyInfos.RegistrationState
@@ -44,7 +44,7 @@
PropertyInfo info = GetInfo(plugin);
// Assert
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailurePathContext), info.DataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.DataType);
Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismProperties), info.PropertyObjectType);
}
}
@@ -58,7 +58,7 @@
mocks.ReplayAll();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var plugin = new WaveImpactAsphaltCoverPlugin())
{
@@ -77,7 +77,7 @@
private static PropertyInfo GetInfo(WaveImpactAsphaltCoverPlugin plugin)
{
- return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverFailurePathContext));
+ return plugin.GetPropertyInfos().First(pi => pi.DataType == typeof(WaveImpactAsphaltCoverFailureMechanismContext));
}
}
}
\ No newline at end of file
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -0,0 +1,393 @@
+// 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.WaveImpactAsphaltCover.Data;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.TreeNodeInfos.HydraulicLoadsState
+{
+ [TestFixture]
+ public class WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest
+ {
+ 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 WaveImpactAsphaltCoverPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ mocks = new MockRepository();
+ plugin = new WaveImpactAsphaltCoverPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveImpactAsphaltCoverFailureMechanismContext));
+ }
+
+ [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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 = (WaveImpactAsphaltCoverCalculationGroupContext) 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 WaveImpactAsphaltCoverFailureMechanism();
+ var assessmentSection = mocks.Stub();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ failureMechanism.CalculationsGroup.Children.Add(new WaveImpactAsphaltCoverWaveConditionsCalculation());
+
+ IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(mocks);
+ var nodeData = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ IAssessmentSection assessmentSection = CreateAssessmentSectionWithHydraulicBoundaryOutput();
+
+ HydraulicBoundaryLocation hydraulicBoundaryLocation = assessmentSection.HydraulicBoundaryDatabase.Locations.First();
+ WaveImpactAsphaltCoverWaveConditionsCalculation calculationA = GetValidCalculation(hydraulicBoundaryLocation);
+ WaveImpactAsphaltCoverWaveConditionsCalculation calculationB = GetValidCalculation(hydraulicBoundaryLocation);
+ List calculations = failureMechanism.CalculationsGroup.Children;
+ calculations.AddRange(new[]
+ {
+ calculationA,
+ calculationB
+ });
+
+ var nodeData = new WaveImpactAsphaltCoverFailureMechanismContext(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(6);
+ 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.Items.Count());
+ Assert.AreEqual(3, calculationB.Output.Items.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 WaveImpactAsphaltCoverWaveConditionsCalculation GetValidCalculation(HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ {
+ return new WaveImpactAsphaltCoverWaveConditionsCalculation
+ {
+ 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/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest.cs (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -0,0 +1,272 @@
+// 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.WaveImpactAsphaltCover.Data;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.TreeNodeInfos.RegistrationState
+{
+ [TestFixture]
+ public class WaveImpactAsphaltCoverFailureMechanismContextTreeNodeInfoTest
+ {
+ private WaveImpactAsphaltCoverPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void Setup()
+ {
+ plugin = new WaveImpactAsphaltCoverPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveImpactAsphaltCoverFailureMechanismContext));
+ }
+
+ [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 WaveImpactAsphaltCoverFailureMechanismContext(new WaveImpactAsphaltCoverFailureMechanism(), assessmentSection);
+
+ // Call
+ string text = info.Text(context);
+
+ // Assert
+ Assert.AreEqual("Golfklappen op asfaltbekleding", 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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 = (WaveImpactAsphaltCoverFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(0);
+ Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism);
+ Assert.AreSame(assessmentSection, failureMechanismResultsContext.AssessmentSection);
+ 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 WaveImpactAsphaltCoverFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism();
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailureMechanism
+ {
+ InAssembly = false
+ };
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(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 WaveImpactAsphaltCoverFailurePathContextInAssemblyTreeNodeInfoTest :
+ FailurePathInAssemblyTreeNodeInfoTestFixtureBase
+ {
+ public WaveImpactAsphaltCoverFailurePathContextInAssemblyTreeNodeInfoTest() : base(2, 0) {}
+
+ protected override WaveImpactAsphaltCoverFailureMechanismContext CreateFailureMechanismContext(WaveImpactAsphaltCoverFailureMechanism failureMechanism,
+ IAssessmentSection assessmentSection)
+ {
+ return new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
+ }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverFailurePathContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 2b84b471a13e5c8189d319143b7357993b3a5e54 refers to a dead (removed) revision in file `Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverHydraulicLoadsContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs
===================================================================
diff -u -rac7f4c3eecc95a1f469ceb08178b77965742b974 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision ac7f4c3eecc95a1f469ceb08178b77965742b974)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/HydraulicLoadsState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.WaveImpactAsphaltCover.Data;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState;
using Riskeer.WaveImpactAsphaltCover.Forms.Views.HydraulicLoadsState;
namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.ViewInfos.HydraulicLoadsState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverHydraulicLoadsContext), info.DataType);
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverHydraulicLoadsContext), info.ViewDataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -84,7 +84,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverHydraulicLoadsContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (WaveImpactAsphaltCoverFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs
===================================================================
diff -u -rac7f4c3eecc95a1f469ceb08178b77965742b974 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision ac7f4c3eecc95a1f469ceb08178b77965742b974)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/RegistrationState/WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismViewInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -26,7 +26,7 @@
using Riskeer.Common.Data.AssessmentSection;
using Riskeer.Common.Data.TestUtil;
using Riskeer.WaveImpactAsphaltCover.Data;
-using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
using Riskeer.WaveImpactAsphaltCover.Forms.Views.RegistrationState;
namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.ViewInfos.RegistrationState
@@ -56,8 +56,8 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailurePathContext), info.DataType);
- Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailurePathContext), info.ViewDataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.DataType);
+ Assert.AreEqual(typeof(WaveImpactAsphaltCoverFailureMechanismContext), info.ViewDataType);
}
[Test]
@@ -68,7 +68,7 @@
mocks.ReplayAll();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
string viewName = info.GetViewName(null, context);
@@ -91,7 +91,7 @@
InAssembly = inAssembly
};
- var context = new WaveImpactAsphaltCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
bool result = info.AdditionalDataCheck(context);
@@ -108,7 +108,7 @@
var assessmentSection = new AssessmentSectionStub();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
// Call
var view = (WaveImpactAsphaltCoverFailureMechanismView) info.CreateInstance(context);
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rc5219e29c90757003a649a2b39d0e18fcbad1782 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs) (revision c5219e29c90757003a649a2b39d0e18fcbad1782)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/ViewInfos/WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs (.../WaveImpactAsphaltCoverFailureMechanismResultViewInfoTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -31,6 +31,7 @@
using Riskeer.Common.Forms.Views;
using Riskeer.WaveImpactAsphaltCover.Data;
using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
+using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState;
namespace Riskeer.WaveImpactAsphaltCover.Plugin.Test.ViewInfos
{
@@ -228,7 +229,7 @@
mocks.ReplayAll();
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
- var context = new WaveImpactAsphaltCoverFailurePathContext(failureMechanism, assessmentSection);
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(failureMechanism, assessmentSection);
using (var view = new NonAdoptableWithProfileProbabilityFailureMechanismResultView(
failureMechanism.SectionResults, failureMechanism, assessmentSection,
@@ -252,7 +253,7 @@
var assessmentSection = mocks.Stub();
mocks.ReplayAll();
- var context = new WaveImpactAsphaltCoverFailurePathContext(
+ var context = new WaveImpactAsphaltCoverFailureMechanismContext(
new WaveImpactAsphaltCoverFailureMechanism(), assessmentSection);
var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism();
Index: Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs
===================================================================
diff -u -rac7f4c3eecc95a1f469ceb08178b77965742b974 -r2b84b471a13e5c8189d319143b7357993b3a5e54
--- Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs (.../WaveImpactAsphaltCoverPluginTest.cs) (revision ac7f4c3eecc95a1f469ceb08178b77965742b974)
+++ Riskeer/WaveImpactAsphaltCover/test/Riskeer.WaveImpactAsphaltCover.Plugin.Test/WaveImpactAsphaltCoverPluginTest.cs (.../WaveImpactAsphaltCoverPluginTest.cs) (revision 2b84b471a13e5c8189d319143b7357993b3a5e54)
@@ -38,6 +38,8 @@
using Riskeer.WaveImpactAsphaltCover.Data;
using Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects;
using Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses;
+using HydraulicLoadsStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismContext;
+using RegistrationStateFailureMechanismContext = Riskeer.WaveImpactAsphaltCover.Forms.PresentationObjects.RegistrationState.WaveImpactAsphaltCoverFailureMechanismContext;
using HydraulicLoadsStateFailureMechanismProperties = Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismProperties;
using RegistrationStateFailureMechanismProperties = Riskeer.WaveImpactAsphaltCover.Forms.PropertyClasses.RegistrationState.WaveImpactAsphaltCoverFailureMechanismProperties;
using HydraulicLoadsStateFailureMechanismView = Riskeer.WaveImpactAsphaltCover.Forms.Views.HydraulicLoadsState.WaveImpactAsphaltCoverFailureMechanismView;
@@ -73,12 +75,12 @@
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(WaveImpactAsphaltCoverHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(WaveImpactAsphaltCoverFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismProperties));
PluginTestHelper.AssertPropertyInfoDefined(
@@ -118,12 +120,12 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(WaveImpactAsphaltCoverHydraulicLoadsContext),
+ typeof(HydraulicLoadsStateFailureMechanismContext),
typeof(HydraulicLoadsStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(WaveImpactAsphaltCoverFailurePathContext),
+ typeof(RegistrationStateFailureMechanismContext),
typeof(RegistrationStateFailureMechanismView));
PluginTestHelper.AssertViewInfoDefined(
@@ -159,8 +161,8 @@
// Assert
Assert.AreEqual(8, treeNodeInfos.Length);
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveImpactAsphaltCoverHydraulicLoadsContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveImpactAsphaltCoverFailurePathContext)));
+ 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(WaveImpactAsphaltCoverFailureMechanismSectionResultContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveImpactAsphaltCoverCalculationGroupContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveImpactAsphaltCoverWaveConditionsCalculationContext)));