Fisheye: Tag 5b421f80047c5b98776fb1c6f4a216775066e805 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj
===================================================================
diff -u -r92ab94a95c16545cca57a9a0e84ffa94404469ee -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Forms/Ringtoets.MacroStabilityInwards.Forms.csproj (.../Ringtoets.MacroStabilityInwards.Forms.csproj) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -20,7 +20,6 @@
-
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs
===================================================================
diff -u -rd57b5fdfd92270ac6eff490b438bbe90f0296a4d -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision d57b5fdfd92270ac6eff490b438bbe90f0296a4d)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Plugin/MacroStabilityInwardsPlugin.cs (.../MacroStabilityInwardsPlugin.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -211,7 +211,7 @@
};
yield return new ViewInfo<
- MacroStabilityInwardsFailureMechanismSectionResultContext,
+ ProbabilityFailureMechanismSectionResultContext,
IEnumerable,
MacroStabilityInwardsFailureMechanismResultView>
{
@@ -283,7 +283,7 @@
CalculationGroupContextContextMenuStrip,
CalculationGroupContextOnNodeRemoved);
- yield return new TreeNodeInfo
+ yield return new TreeNodeInfo>
{
Text = context => RingtoetsCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName,
Image = context => RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon,
@@ -705,7 +705,7 @@
return new object[]
{
new MacroStabilityInwardsScenariosContext(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection),
- new MacroStabilityInwardsFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection),
+ new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection),
failureMechanism.OutputComments
};
}
Fisheye: Tag 5b421f80047c5b98776fb1c6f4a216775066e805 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/MacroStabilityInwardsFailureMechanismSectionResultContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/ProbabilityFailureMechanismSectionResultContextTest.cs
===================================================================
diff -u
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/ProbabilityFailureMechanismSectionResultContextTest.cs (revision 0)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PresentationObjects/ProbabilityFailureMechanismSectionResultContextTest.cs (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -0,0 +1,70 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using NUnit.Framework;
+using Rhino.Mocks;
+using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Forms.PresentationObjects;
+using Ringtoets.MacroStabilityInwards.Data;
+
+namespace Ringtoets.MacroStabilityInwards.Forms.Test.PresentationObjects
+{
+ [TestFixture]
+ public class ProbabilityFailureMechanismSectionResultContextTest
+ {
+ [Test]
+ public void Constructor_AssessmentSectionNull_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate call = () => new ProbabilityFailureMechanismSectionResultContext(Enumerable.Empty(),
+ new MacroStabilityInwardsFailureMechanism(), null);
+
+ // Assert
+ var exception = Assert.Throws(call);
+ Assert.AreEqual("assessmentSection", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Setup
+ var mocks = new MockRepository();
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ IEnumerable sectionResults = Enumerable.Empty();
+ var failureMechanism = new MacroStabilityInwardsFailureMechanism();
+
+ // Call
+ var context = new ProbabilityFailureMechanismSectionResultContext (sectionResults, failureMechanism, assessmentSection);
+
+ // Assert
+ Assert.IsInstanceOf>(context);
+ Assert.AreSame(sectionResults, context.WrappedData);
+ Assert.AreSame(failureMechanism, context.FailureMechanism);
+ Assert.AreSame(assessmentSection, context.AssessmentSection);
+ mocks.VerifyAll();
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj
===================================================================
diff -u -r92ab94a95c16545cca57a9a0e84ffa94404469ee -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 92ab94a95c16545cca57a9a0e84ffa94404469ee)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Ringtoets.MacroStabilityInwards.Forms.Test.csproj (.../Ringtoets.MacroStabilityInwards.Forms.Test.csproj) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -29,7 +29,7 @@
-
+
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs
===================================================================
diff -u -rfb3c4216478c0f072cf2f1a94053e81756ced5c7 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs (.../MacroStabilityInwardsPluginTest.cs) (revision fb3c4216478c0f072cf2f1a94053e81756ced5c7)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/MacroStabilityInwardsPluginTest.cs (.../MacroStabilityInwardsPluginTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -130,7 +130,7 @@
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsCalculationGroupContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsInputContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsFailureMechanismContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsFailureMechanismSectionResultContext)));
+ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ProbabilityFailureMechanismSectionResultContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsOutputContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(MacroStabilityInwardsScenariosContext)));
}
@@ -155,7 +155,7 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(MacroStabilityInwardsFailureMechanismSectionResultContext),
+ typeof(ProbabilityFailureMechanismSectionResultContext),
typeof(IEnumerable),
typeof(MacroStabilityInwardsFailureMechanismResultView));
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u -rceefc700930d8a8d9ff88644c129804990dcc9c9 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision ceefc700930d8a8d9ff88644c129804990dcc9c9)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -177,7 +177,7 @@
Assert.AreSame(failureMechanism.CalculationsGroup, failureMechanismScenariosContext.WrappedData);
Assert.AreSame(assessmentSection, failureMechanismScenariosContext.AssessmentSection);
- var failureMechanismResultsContext = (MacroStabilityInwardsFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
+ var failureMechanismResultsContext = (ProbabilityFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
Assert.AreSame(failureMechanism, failureMechanismResultsContext.FailureMechanism);
Assert.AreSame(failureMechanism.SectionResults, failureMechanismResultsContext.WrappedData);
Assert.AreSame(assessmentSection, failureMechanismResultsContext.AssessmentSection);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs
===================================================================
diff -u -rfb3c4216478c0f072cf2f1a94053e81756ced5c7 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision fb3c4216478c0f072cf2f1a94053e81756ced5c7)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/TreeNodeInfos/MacroStabilityInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs (.../MacroStabilityInwardsFailureMechanismSectionResultContextTreeNodeInfoTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -28,8 +28,8 @@
using NUnit.Framework;
using Rhino.Mocks;
using Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.MacroStabilityInwards.Data;
-using Ringtoets.MacroStabilityInwards.Forms.PresentationObjects;
using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
namespace Ringtoets.MacroStabilityInwards.Plugin.Test.TreeNodeInfos
@@ -46,7 +46,7 @@
{
mocks = new MockRepository();
plugin = new MacroStabilityInwardsPlugin();
- info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(MacroStabilityInwardsFailureMechanismSectionResultContext));
+ info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(ProbabilityFailureMechanismSectionResultContext));
}
[TearDown]
@@ -91,7 +91,7 @@
mocks.ReplayAll();
var mechanism = new MacroStabilityInwardsFailureMechanism();
- var context = new MacroStabilityInwardsFailureMechanismSectionResultContext(mechanism.SectionResults, mechanism, assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(mechanism.SectionResults, mechanism, assessmentSection);
// Call
string text = info.Text(context);
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rfb3c4216478c0f072cf2f1a94053e81756ced5c7 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs) (revision fb3c4216478c0f072cf2f1a94053e81756ced5c7)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/ViewInfos/MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs (.../MacroStabilityInwardsFailureMechanismResultViewInfoTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -19,7 +19,6 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
-using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -64,7 +63,7 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(MacroStabilityInwardsFailureMechanismSectionResultContext), info.DataType);
+ Assert.AreEqual(typeof(ProbabilityFailureMechanismSectionResultContext), info.DataType);
Assert.AreEqual(typeof(IEnumerable), info.ViewDataType);
}
@@ -76,7 +75,7 @@
mocks.ReplayAll();
var failureMechanism = new MacroStabilityInwardsFailureMechanism();
- var context = new MacroStabilityInwardsFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection);
// Call
object viewData = info.GetViewData(context);
@@ -308,7 +307,9 @@
mocks.ReplayAll();
var failureMechanism = new MacroStabilityInwardsFailureMechanism();
- var context = new MacroStabilityInwardsFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults,
+ failureMechanism,
+ assessmentSection);
var view = mocks.StrictMock();
view.Expect(v => v.FailureMechanism = failureMechanism);
@@ -330,9 +331,9 @@
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
- var context = new MacroStabilityInwardsFailureMechanismSectionResultContext(failureMechanism.SectionResults,
- failureMechanism,
- assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults,
+ failureMechanism,
+ assessmentSection);
// Call
IView view = info.CreateInstance(context);
Fisheye: Tag 5b421f80047c5b98776fb1c6f4a216775066e805 refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Forms/PresentationObjects/PipingFailureMechanismSectionResultContext.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj
===================================================================
diff -u -rb9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision b9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Ringtoets.Piping.Forms.csproj (.../Ringtoets.Piping.Forms.csproj) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -23,7 +23,6 @@
-
Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs
===================================================================
diff -u -rf57667ae790c7ec25c771819e4efe75c2d221d9b -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision f57667ae790c7ec25c771819e4efe75c2d221d9b)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingPlugin.cs (.../PipingPlugin.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -208,7 +208,7 @@
};
yield return new ViewInfo<
- PipingFailureMechanismSectionResultContext,
+ ProbabilityFailureMechanismSectionResultContext,
IEnumerable,
PipingFailureMechanismResultView>
{
@@ -272,7 +272,7 @@
PipingCalculationGroupContextContextMenuStrip,
PipingCalculationGroupContextOnNodeRemoved);
- yield return new TreeNodeInfo
+ yield return new TreeNodeInfo>
{
Text = context => RingtoetsCommonFormsResources.FailureMechanism_AssessmentResult_DisplayName,
Image = context => RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon,
@@ -532,19 +532,15 @@
private void CalculateAll(PipingFailureMechanismContext failureMechanismContext)
{
IEnumerable calculations = GetAllPipingCalculations(failureMechanismContext.WrappedData);
- PipingProbabilityAssessmentInput assessmentInput = failureMechanismContext.WrappedData.PipingProbabilityAssessmentInput;
- double contribution = failureMechanismContext.WrappedData.Contribution;
- CalculateAll(calculations, assessmentInput, contribution, failureMechanismContext.Parent);
+ CalculateAll(calculations, failureMechanismContext.Parent);
}
private void CalculateAll(CalculationGroup group, PipingCalculationGroupContext context)
{
PipingCalculation[] calculations = group.GetCalculations().OfType().ToArray();
- PipingProbabilityAssessmentInput assessmentInput = context.FailureMechanism.PipingProbabilityAssessmentInput;
- double contribution = context.FailureMechanism.Contribution;
- CalculateAll(calculations, assessmentInput, contribution, context.AssessmentSection);
+ CalculateAll(calculations, context.AssessmentSection);
}
private static void ValidateAll(IEnumerable pipingCalculations, IAssessmentSection assessmentSection)
@@ -556,8 +552,6 @@
}
private void CalculateAll(IEnumerable calculations,
- PipingProbabilityAssessmentInput assessmentInput,
- double contribution,
IAssessmentSection assessmentSection)
{
ActivityProgressDialogRunner.Run(
@@ -715,7 +709,7 @@
return new object[]
{
new PipingScenariosContext(failureMechanism.CalculationsGroup, failureMechanism, assessmentSection),
- new PipingFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection),
+ new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism, assessmentSection),
failureMechanism.OutputComments
};
}
Fisheye: Tag 5b421f80047c5b98776fb1c6f4a216775066e805 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PresentationObjects/PipingFailureMechanismSectionResultContextTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj
===================================================================
diff -u -rb9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision b9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/Ringtoets.Piping.Forms.Test.csproj (.../Ringtoets.Piping.Forms.Test.csproj) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -28,7 +28,6 @@
-
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs
===================================================================
diff -u -rb9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision b9e7df65b2b31d7b0c9faf17926dde1efbbf4cb4)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/PipingPluginTest.cs (.../PipingPluginTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -132,7 +132,7 @@
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingCalculationGroupContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingInputContext)));
Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingFailureMechanismContext)));
- Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(PipingFailureMechanismSectionResultContext)));
+ 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)));
@@ -158,7 +158,7 @@
PluginTestHelper.AssertViewInfoDefined(
viewInfos,
- typeof(PipingFailureMechanismSectionResultContext),
+ typeof(ProbabilityFailureMechanismSectionResultContext),
typeof(IEnumerable),
typeof(PipingFailureMechanismResultView));
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj
===================================================================
diff -u -r4e9d3556e3cee0365fc0f26d0bad19b50594e12d -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision 4e9d3556e3cee0365fc0f26d0bad19b50594e12d)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/Ringtoets.Piping.Plugin.Test.csproj (.../Ringtoets.Piping.Plugin.Test.csproj) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -54,7 +54,7 @@
-
+
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs
===================================================================
diff -u -rceefc700930d8a8d9ff88644c129804990dcc9c9 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision ceefc700930d8a8d9ff88644c129804990dcc9c9)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismContextTreeNodeInfoTest.cs (.../PipingFailureMechanismContextTreeNodeInfoTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -192,7 +192,7 @@
Assert.AreSame(pipingFailureMechanism.CalculationsGroup, failureMechanismScenariosContext.WrappedData);
Assert.AreSame(assessmentSection, failureMechanismScenariosContext.AssessmentSection);
- var failureMechanismResultsContext = (PipingFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
+ var failureMechanismResultsContext = (ProbabilityFailureMechanismSectionResultContext) outputsFolder.Contents.ElementAt(1);
Assert.AreSame(pipingFailureMechanism, failureMechanismResultsContext.FailureMechanism);
Assert.AreSame(pipingFailureMechanism.SectionResults, failureMechanismResultsContext.WrappedData);
Assert.AreSame(assessmentSection, failureMechanismResultsContext.AssessmentSection);
Fisheye: Tag 5b421f80047c5b98776fb1c6f4a216775066e805 refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/PipingFailureMechanismSectionResultContextTreeNodeInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/ProbabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs
===================================================================
diff -u
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/ProbabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 0)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/TreeNodeInfos/ProbabilityFailureMechanismSectionResultContextTreeNodeInfoTest.cs (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -0,0 +1,140 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets 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 Ringtoets.Common.Data.AssessmentSection;
+using Ringtoets.Common.Forms.PresentationObjects;
+using Ringtoets.Piping.Data;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Piping.Plugin.Test.TreeNodeInfos
+{
+ [TestFixture]
+ public class ProbabilityFailureMechanismSectionResultContextTreeNodeInfoTest
+ {
+ 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(ProbabilityFailureMechanismSectionResultContext));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ mocks.VerifyAll();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // 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.IsChecked);
+ 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()
+ {
+ // Setup
+ var assessmentSection = mocks.Stub();
+ mocks.ReplayAll();
+
+ var mechanism = new PipingFailureMechanism();
+ var context = new ProbabilityFailureMechanismSectionResultContext(mechanism.SectionResults, mechanism, assessmentSection);
+
+ // Call
+ string text = info.Text(context);
+
+ // Assert
+ Assert.AreEqual("Resultaat", text);
+ }
+
+ [Test]
+ public void Image_Always_ReturnsGenericInputOutputIcon()
+ {
+ // Setup
+ mocks.ReplayAll();
+
+ // Call
+ Image image = info.Image(null);
+
+ // Assert
+ TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismSectionResultIcon, image);
+ }
+
+ [Test]
+ public void ContextMenuStrip_Always_CallsBuilder()
+ {
+ // Setup
+ 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);
+
+ 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: Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs
===================================================================
diff -u -rfb3c4216478c0f072cf2f1a94053e81756ced5c7 -r5b421f80047c5b98776fb1c6f4a216775066e805
--- Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs (.../PipingFailureMechanismResultViewInfoTest.cs) (revision fb3c4216478c0f072cf2f1a94053e81756ced5c7)
+++ Ringtoets/Piping/test/Ringtoets.Piping.Plugin.Test/ViewInfos/PipingFailureMechanismResultViewInfoTest.cs (.../PipingFailureMechanismResultViewInfoTest.cs) (revision 5b421f80047c5b98776fb1c6f4a216775066e805)
@@ -30,6 +30,7 @@
using Ringtoets.Common.Data.AssessmentSection;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Piping.Data;
using Ringtoets.Piping.Forms.PresentationObjects;
using Ringtoets.Piping.Forms.Views;
@@ -62,7 +63,7 @@
public void Initialized_Always_ExpectedPropertiesSet()
{
// Assert
- Assert.AreEqual(typeof(PipingFailureMechanismSectionResultContext), info.DataType);
+ Assert.AreEqual(typeof(ProbabilityFailureMechanismSectionResultContext), info.DataType);
Assert.AreEqual(typeof(IEnumerable), info.ViewDataType);
}
@@ -74,9 +75,9 @@
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
- var context = new PipingFailureMechanismSectionResultContext(failureMechanism.SectionResults,
- failureMechanism,
- assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults,
+ failureMechanism,
+ assessmentSection);
// Call
object viewData = info.GetViewData(context);
@@ -311,9 +312,9 @@
view.Expect(v => v.FailureMechanism = failureMechanism);
mocks.ReplayAll();
- var context = new PipingFailureMechanismSectionResultContext(failureMechanism.SectionResults,
- failureMechanism,
- assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults,
+ failureMechanism,
+ assessmentSection);
// Call
info.AfterCreate(view, context);
@@ -331,9 +332,9 @@
IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(failureMechanism, mocks);
mocks.ReplayAll();
- var context = new PipingFailureMechanismSectionResultContext(failureMechanism.SectionResults,
- failureMechanism,
- assessmentSection);
+ var context = new ProbabilityFailureMechanismSectionResultContext(failureMechanism.SectionResults,
+ failureMechanism,
+ assessmentSection);
// Call
IView view = info.CreateInstance(context);