Fisheye: Tag 12548da615d4bb7db74af2424712b938aeaaef75 refers to a dead (removed) revision in file `Riskeer/Piping/src/Riskeer.Piping.Forms/PresentationObjects/EmptyPipingOutput.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/Piping/src/Riskeer.Piping.Forms/PresentationObjects/EmptySemiProbabilisticPipingOutput.cs
===================================================================
diff -u
--- Riskeer/Piping/src/Riskeer.Piping.Forms/PresentationObjects/EmptySemiProbabilisticPipingOutput.cs (revision 0)
+++ Riskeer/Piping/src/Riskeer.Piping.Forms/PresentationObjects/EmptySemiProbabilisticPipingOutput.cs (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -0,0 +1,31 @@
+// Copyright (C) Stichting Deltares 2019. 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 Riskeer.Piping.Data.SemiProbabilistic;
+
+namespace Riskeer.Piping.Forms.PresentationObjects
+{
+ ///
+ /// This class represents the placeholder for a for a
+ /// that hasn't been calculated yet.
+ ///
+ public class EmptySemiProbabilisticPipingOutput {}
+}
\ No newline at end of file
Index: Riskeer/Piping/src/Riskeer.Piping.Plugin/PipingPlugin.cs
===================================================================
diff -u -rf4359dde195c85255ac1aa2373710dc709f65a56 -r12548da615d4bb7db74af2424712b938aeaaef75
--- Riskeer/Piping/src/Riskeer.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision f4359dde195c85255ac1aa2373710dc709f65a56)
+++ Riskeer/Piping/src/Riskeer.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -408,7 +408,7 @@
.Build()
};
- yield return new TreeNodeInfo
+ yield return new TreeNodeInfo
{
Text = emptyPipingOutput => RiskeerCommonFormsResources.CalculationOutput_DisplayName,
Image = emptyPipingOutput => RiskeerCommonFormsResources.GeneralOutputIcon,
@@ -955,7 +955,7 @@
}
else
{
- childNodes.Add(new EmptyPipingOutput());
+ childNodes.Add(new EmptySemiProbabilisticPipingOutput());
}
return childNodes.ToArray();
@@ -1028,7 +1028,7 @@
context.AvailableStochasticSoilModels,
context.FailureMechanism,
context.AssessmentSection),
- new EmptyPipingOutput()
+ new EmptySemiProbabilisticPipingOutput()
};
return childNodes.ToArray();
Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/PipingPluginTest.cs
===================================================================
diff -u -r49f74b91e9188a8e74619a59fc7d90ad7c2bb20c -r12548da615d4bb7db74af2424712b938aeaaef75
--- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 49f74b91e9188a8e74619a59fc7d90ad7c2bb20c)
+++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -145,7 +145,7 @@
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ProbabilityFailureMechanismSectionResultContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingOutputContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingScenariosContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyPipingOutput)));
+ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptySemiProbabilisticPipingOutput)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ProbabilisticPipingCalculationContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ProbabilisticPipingInputContext)));
}
Fisheye: Tag 12548da615d4bb7db74af2424712b938aeaaef75 refers to a dead (removed) revision in file `Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/EmptyPipingOutputTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/EmptySemiProbabilisticPipingOutputTreeNodeInfoTest.cs
===================================================================
diff -u
--- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/EmptySemiProbabilisticPipingOutputTreeNodeInfoTest.cs (revision 0)
+++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/EmptySemiProbabilisticPipingOutputTreeNodeInfoTest.cs (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -0,0 +1,150 @@
+// Copyright (C) Stichting Deltares 2019. 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.Gui;
+using Core.Common.Gui.ContextMenu;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Riskeer.Piping.Forms.PresentationObjects;
+using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources;
+
+namespace Riskeer.Piping.Plugin.Test.TreeNodeInfos
+{
+ [TestFixture]
+ public class EmptySemiProbabilisticPipingOutputTreeNodeInfoTest
+ {
+ private MockRepository mocks;
+ private PipingPlugin plugin;
+ private TreeNodeInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ mocks = new MockRepository();
+ plugin = new PipingPlugin();
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(EmptySemiProbabilisticPipingOutput));
+ }
+
+ [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.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_ReturnsFromResource()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Call
+ string text = info.Text(null);
+
+ // Assert
+ Assert.AreEqual("Resultaat", text);
+ }
+
+ [Test]
+ public void Image_Always_ReturnsGeneralOutputIcon()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Call
+ Image image = info.Image(null);
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.GeneralOutputIcon, image);
+ }
+
+ [Test]
+ public void ForeColor_Always_ReturnsGrayText()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Call
+ Color textColor = info.ForeColor(null);
+
+ // Assert
+ Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), textColor);
+ }
+
+ [Test]
+ public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods()
+ {
+ // Setup
+ var menuBuilder = mocks.StrictMock();
+ using (mocks.Ordered())
+ {
+ menuBuilder.Expect(mb => mb.AddPropertiesItem()).Return(menuBuilder);
+ menuBuilder.Expect(mb => mb.Build()).Return(null);
+ }
+
+ using (var treeViewControl = new TreeViewControl())
+ {
+ var gui = mocks.Stub();
+ gui.Stub(cmp => cmp.Get(null, treeViewControl)).Return(menuBuilder);
+ mocks.ReplayAll();
+
+ plugin.Gui = gui;
+
+ // Call
+ info.ContextMenuStrip(null, null, treeViewControl);
+ }
+
+ // Assert
+ // Assert expectancies are called in TearDown()
+ }
+ }
+}
\ No newline at end of file
Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs
===================================================================
diff -u -rf4359dde195c85255ac1aa2373710dc709f65a56 -r12548da615d4bb7db74af2424712b938aeaaef75
--- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision f4359dde195c85255ac1aa2373710dc709f65a56)
+++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/PipingCalculationScenarioContextTreeNodeInfoTest.cs (.../PipingCalculationScenarioContextTreeNodeInfoTest.cs) (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -179,7 +179,7 @@
CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines);
CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels);
- Assert.IsInstanceOf(children[2]);
+ Assert.IsInstanceOf(children[2]);
}
[Test]
Index: Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/ProbabilisticPipingCalculationContextTreeNodeInfoTest.cs
===================================================================
diff -u -rf4359dde195c85255ac1aa2373710dc709f65a56 -r12548da615d4bb7db74af2424712b938aeaaef75
--- Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/ProbabilisticPipingCalculationContextTreeNodeInfoTest.cs (.../ProbabilisticPipingCalculationContextTreeNodeInfoTest.cs) (revision f4359dde195c85255ac1aa2373710dc709f65a56)
+++ Riskeer/Piping/test/Riskeer.Piping.Plugin.Test/TreeNodeInfos/ProbabilisticPipingCalculationContextTreeNodeInfoTest.cs (.../ProbabilisticPipingCalculationContextTreeNodeInfoTest.cs) (revision 12548da615d4bb7db74af2424712b938aeaaef75)
@@ -172,7 +172,7 @@
CollectionAssert.AreEqual(pipingCalculationContext.AvailablePipingSurfaceLines, pipingInputContext.AvailablePipingSurfaceLines);
CollectionAssert.AreEqual(pipingCalculationContext.AvailableStochasticSoilModels, pipingInputContext.AvailableStochasticSoilModels);
- Assert.IsInstanceOf(children[2]);
+ Assert.IsInstanceOf(children[2]);
}
[Test]