Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismSectionResultContext.cs
===================================================================
diff -u
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismSectionResultContext.cs (revision 0)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresFailureMechanismSectionResultContext.cs (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -0,0 +1,50 @@
+// 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 Core.Common.Base;
+using Riskeer.Common.Data.AssessmentSection;
+using Riskeer.Common.Data.FailureMechanism;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.HeightStructures.Data;
+
+namespace Riskeer.HeightStructures.Forms.PresentationObjects
+{
+ ///
+ /// This class is a presentation object for a collection of
+ /// for the .
+ ///
+ public class HeightStructuresFailureMechanismSectionResultContext : FailureMechanismSectionResultContext
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The
+ /// of to wrap.
+ /// The
+ /// the belongs to.
+ /// The assessment section the section results belongs to.
+ /// Thrown when any parameter is null.
+ public HeightStructuresFailureMechanismSectionResultContext(IObservableEnumerable wrappedSectionResults,
+ HeightStructuresFailureMechanism failureMechanism, IAssessmentSection assessmentSection)
+ : base(wrappedSectionResults, failureMechanism, assessmentSection) {}
+ }
+}
\ No newline at end of file
Fisheye: Tag 8ba64004e28058fce306a424a0cfe9d6b17c814e refers to a dead (removed) revision in file `Riskeer/HeightStructures/src/Riskeer.HeightStructures.Forms/PresentationObjects/HeightStructuresProbabilityFailureMechanismSectionResultContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs
===================================================================
diff -u -r09fda91ef087b3955cdc6eb758901340b72ee4db -r8ba64004e28058fce306a424a0cfe9d6b17c814e
--- Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 09fda91ef087b3955cdc6eb758901340b72ee4db)
+++ Riskeer/HeightStructures/src/Riskeer.HeightStructures.Plugin/HeightStructuresPlugin.cs (.../HeightStructuresPlugin.cs) (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -186,7 +186,7 @@
};
yield return new RiskeerViewInfo<
- HeightStructuresProbabilityFailureMechanismSectionResultContext,
+ HeightStructuresFailureMechanismSectionResultContext,
IObservableEnumerable,
StructuresFailureMechanismResultView>(() => Gui)
{
@@ -277,7 +277,7 @@
.Build()
};
- yield return new TreeNodeInfo
+ yield return new TreeNodeInfo
{
Text = context => RiskeerCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName,
Image = context => RiskeerCommonFormsResources.FailureMechanismSectionResultIcon,
@@ -477,7 +477,7 @@
return new object[]
{
new HeightStructuresScenariosContext(failureMechanism.CalculationsGroup, failureMechanism),
- new HeightStructuresProbabilityFailureMechanismSectionResultContext(
+ new HeightStructuresFailureMechanismSectionResultContext(
failureMechanism.SectionResults, failureMechanism, assessmentSection),
failureMechanism.InAssemblyOutputComments
};
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismSectionResultContextTest.cs
===================================================================
diff -u
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismSectionResultContextTest.cs (revision 0)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresFailureMechanismSectionResultContextTest.cs (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -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.Data.FailureMechanism;
+using Riskeer.Common.Forms.PresentationObjects;
+using Riskeer.HeightStructures.Data;
+using Riskeer.HeightStructures.Forms.PresentationObjects;
+
+namespace Riskeer.HeightStructures.Forms.Test.PresentationObjects
+{
+ [TestFixture]
+ public class HeightStructuresFailureMechanismSectionResultContextTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var failureMechanism = new HeightStructuresFailureMechanism();
+
+ // Call
+ var context = new HeightStructuresFailureMechanismSectionResultContext(
+ failureMechanism.SectionResults, failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 8ba64004e28058fce306a424a0cfe9d6b17c814e refers to a dead (removed) revision in file `Riskeer/HeightStructures/test/Riskeer.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresProbabilityFailureMechanismSectionResultContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/HeightStructuresPluginTest.cs
===================================================================
diff -u -r8871305b1487621444a088cad1b9410428f38f8e -r8ba64004e28058fce306a424a0cfe9d6b17c814e
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/HeightStructuresPluginTest.cs (.../HeightStructuresPluginTest.cs) (revision 8871305b1487621444a088cad1b9410428f38f8e)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/HeightStructuresPluginTest.cs (.../HeightStructuresPluginTest.cs) (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -113,7 +113,7 @@
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HeightStructuresContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HeightStructure)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HeightStructuresScenariosContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HeightStructuresProbabilityFailureMechanismSectionResultContext)));
+ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HeightStructuresFailureMechanismSectionResultContext)));
}
}
@@ -153,7 +153,7 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(HeightStructuresProbabilityFailureMechanismSectionResultContext),
+ typeof(HeightStructuresFailureMechanismSectionResultContext),
typeof(IObservableEnumerable),
typeof(StructuresFailureMechanismResultView));
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -0,0 +1,126 @@
+// 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.HeightStructures.Forms.PresentationObjects;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.HeightStructures.Plugin.Test.TreeNodeInfos
+{
+ [TestFixture]
+ public class HeightStructuresFailureMechanismSectionResultContextTreeNodeInfoTest
+ {
+ private HeightStructuresPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new HeightStructuresPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(HeightStructuresFailureMechanismSectionResultContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Assert
+ Assert.IsNotNull(info.Text);
+ Assert.IsNull(info.ForeColor);
+ Assert.IsNotNull(info.Image);
+ Assert.IsNotNull(info.ContextMenuStrip);
+ Assert.IsNull(info.EnsureVisibleOnCreate);
+ Assert.IsNull(info.ExpandOnCreate);
+ Assert.IsNull(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_Always_ReturnsName()
+ {
+ // Call
+ string text = info.Text(null);
+
+ // Assert
+ Assert.AreEqual(RiskeerCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName, text);
+ }
+
+ [Test]
+ public void Image_Always_ReturnsFailureMechanismSectionResultIcon()
+ {
+ // Call
+ Image image = info.Image(null);
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.FailureMechanismSectionResultIcon, image);
+ }
+
+ [Test]
+ public void ContextMenuStrip_Always_CallsBuilder()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var menuBuilder = mocks.StrictMock();
+ menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.Build()).Return(null);
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var gui = mocks.Stub();
+ gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder);
+ gui.Stub(g => g.ProjectOpened += null).IgnoreArguments();
+ gui.Stub(g => g.ProjectOpened -= null).IgnoreArguments();
+
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ info.ContextMenuStrip(null, null, treeViewControl);
+ }
+
+ // Assert
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailurePathContextTreeNodeInfoTest.cs
===================================================================
diff -u -r09fda91ef087b3955cdc6eb758901340b72ee4db -r8ba64004e28058fce306a424a0cfe9d6b17c814e
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailurePathContextTreeNodeInfoTest.cs (.../HeightStructuresFailurePathContextTreeNodeInfoTest.cs) (revision 09fda91ef087b3955cdc6eb758901340b72ee4db)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresFailurePathContextTreeNodeInfoTest.cs (.../HeightStructuresFailurePathContextTreeNodeInfoTest.cs) (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -144,7 +144,7 @@
Assert.AreSame(failureMechanism, scenariosContext.ParentFailureMechanism);
Assert.AreSame(failureMechanism.CalculationsGroup, scenariosContext.WrappedData);
- var failureMechanismResultsContext = (HeightStructuresProbabilityFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
+ var failureMechanismResultsContext = (HeightStructuresFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism);
Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData);
Assert.AreSame(assessmentSection, failureMechanismResultsContext.AssessmentSection);
Fisheye: Tag 8ba64004e28058fce306a424a0cfe9d6b17c814e refers to a dead (removed) revision in file `Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresProbabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rd5057ee878545d62057b1ac279a987056440ba70 -r8ba64004e28058fce306a424a0cfe9d6b17c814e
--- Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismResultViewInfoTest.cs (.../HeightStructuresFailureMechanismResultViewInfoTest.cs) (revision d5057ee878545d62057b1ac279a987056440ba70)
+++ Riskeer/HeightStructures/test/Riskeer.HeightStructures.Plugin.Test/ViewInfos/HeightStructuresFailureMechanismResultViewInfoTest.cs (.../HeightStructuresFailureMechanismResultViewInfoTest.cs) (revision 8ba64004e28058fce306a424a0cfe9d6b17c814e)
@@ -57,7 +57,7 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(HeightStructuresProbabilityFailureMechanismSectionResultContext), info.DataType);
+ Assert.AreEqual(typeof(HeightStructuresFailureMechanismSectionResultContext), info.DataType);
Assert.AreEqual(typeof(IObservableEnumerable), info.ViewDataType);
}
@@ -81,7 +81,7 @@
var failureMechanism = new HeightStructuresFailureMechanism();
- var context = new HeightStructuresProbabilityFailureMechanismSectionResultContext(
+ var context = new HeightStructuresFailureMechanismSectionResultContext(
failureMechanism.SectionResults, failureMechanism, assessmentSection);
// Call
@@ -260,7 +260,7 @@
IAssessmentSection assessmentSection = AssessmentSectionTestHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
- var context = new HeightStructuresProbabilityFailureMechanismSectionResultContext(
+ var context = new HeightStructuresFailureMechanismSectionResultContext(
failureMechanism.SectionResults, failureMechanism, assessmentSection);
// Call