Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/IllustrationPointContext.cs
===================================================================
diff -u
--- Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/IllustrationPointContext.cs (revision 0)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/PresentationObjects/IllustrationPointContext.cs (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -0,0 +1,92 @@
+// 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 Ringtoets.Common.Data.IllustrationPoints;
+
+namespace Ringtoets.Common.Forms.PresentationObjects
+{
+ ///
+ /// This class is a presentation object for an which'
+ /// is of type .
+ ///
+ /// The type of the illustration point.
+ public class IllustrationPointContext where T : IllustrationPointBase
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The illustration point.
+ /// The illustration point node.
+ /// The name of the wind direction.
+ /// The closing situation of the illustration point.
+ /// Thrown when any of the input parameters is null.
+ /// Thrown when
+ /// is not of type .
+ public IllustrationPointContext(T illustrationPoint,
+ IllustrationPointNode illustrationPointNode,
+ string windDirectionName,
+ string closingSituation)
+ {
+ if (illustrationPoint == null)
+ {
+ throw new ArgumentNullException(nameof(illustrationPoint));
+ }
+ if (illustrationPointNode == null)
+ {
+ throw new ArgumentNullException(nameof(illustrationPointNode));
+ }
+ if (windDirectionName == null)
+ {
+ throw new ArgumentNullException(nameof(windDirectionName));
+ }
+ if (closingSituation == null)
+ {
+ throw new ArgumentNullException(nameof(closingSituation));
+ }
+
+ IllustrationPoint = illustrationPoint;
+ IllustrationPointNode = illustrationPointNode;
+ WindDirectionName = windDirectionName;
+ ClosingSituation = closingSituation;
+ }
+
+ ///
+ /// Gets the illustration point.
+ ///
+ public T IllustrationPoint { get; }
+
+ ///
+ /// Gets the illustration point node.
+ ///
+ public IllustrationPointNode IllustrationPointNode { get; }
+
+ ///
+ /// Gets the wind direction name.
+ ///
+ public string WindDirectionName { get; }
+
+ ///
+ /// Gets the closing situation.
+ ///
+ public string ClosingSituation { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/TopLevelFaultTreeIllustrationPointProperties.cs
===================================================================
diff -u -rb2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/TopLevelFaultTreeIllustrationPointProperties.cs (.../TopLevelFaultTreeIllustrationPointProperties.cs) (revision b2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/TopLevelFaultTreeIllustrationPointProperties.cs (.../TopLevelFaultTreeIllustrationPointProperties.cs) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -145,19 +145,21 @@
var points = new List();
foreach (IllustrationPointNode illustrationPointNode in data.FaultTreeNodeRoot.Children)
{
+ string closingSituation = areClosingSituationsSame ? string.Empty : ClosingSituation;
+
if (illustrationPointNode.Data is FaultTreeIllustrationPoint)
{
points.Add(new FaultTreeIllustrationPointProperties(illustrationPointNode,
WindDirection,
- areClosingSituationsSame ? string.Empty : ClosingSituation));
+ closingSituation));
continue;
}
if (illustrationPointNode.Data is SubMechanismIllustrationPoint)
{
points.Add(new SubMechanismIllustrationPointProperties(illustrationPointNode,
WindDirection,
- areClosingSituationsSame ? string.Empty : ClosingSituation));
+ closingSituation));
continue;
}
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj
===================================================================
diff -u -rb2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision b2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -76,7 +76,7 @@
-
+
Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/GeneralResultFaultTreeIllustrationPointView.cs
===================================================================
diff -u -r2e944cbf52d124fd501ed4ed8e991aa50299cc69 -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/GeneralResultFaultTreeIllustrationPointView.cs (.../GeneralResultFaultTreeIllustrationPointView.cs) (revision 2e944cbf52d124fd501ed4ed8e991aa50299cc69)
+++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/GeneralResultFaultTreeIllustrationPointView.cs (.../GeneralResultFaultTreeIllustrationPointView.cs) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -127,14 +127,26 @@
return;
}
- bool areClosingSituationsSame = generalResult.TopLevelIllustrationPoints
- .HasDuplicates(p => p.ClosingSituation);
+ string closingSituation = generalResult.TopLevelIllustrationPoints.HasDuplicates(p => p.ClosingSituation)
+ ? string.Empty
+ : topLevelFaultTreeIllustrationPoint.ClosingSituation;
- Selection = new IllustrationPointNodeContext(selection,
- topLevelFaultTreeIllustrationPoint.WindDirection.Name,
- areClosingSituationsSame
- ? string.Empty
- : topLevelFaultTreeIllustrationPoint.ClosingSituation);
+ var faultTreeIllustrationPoint = selection.Data as FaultTreeIllustrationPoint;
+ if (faultTreeIllustrationPoint != null)
+ {
+ Selection = new IllustrationPointContext(faultTreeIllustrationPoint,
+ selection,
+ topLevelFaultTreeIllustrationPoint.WindDirection.Name,
+ closingSituation);
+ }
+ var subMechanismIllustrationPoint = selection.Data as SubMechanismIllustrationPoint;
+ if (subMechanismIllustrationPoint != null)
+ {
+ Selection = new IllustrationPointContext(subMechanismIllustrationPoint,
+ selection,
+ topLevelFaultTreeIllustrationPoint.WindDirection.Name,
+ closingSituation);
+ }
OnSelectionChanged();
}
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/IllustrationPointContextTest.cs
===================================================================
diff -u
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/IllustrationPointContextTest.cs (revision 0)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PresentationObjects/IllustrationPointContextTest.cs (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -0,0 +1,105 @@
+// 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 NUnit.Framework;
+using Ringtoets.Common.Data.IllustrationPoints;
+using Ringtoets.Common.Data.TestUtil.IllustrationPoints;
+using Ringtoets.Common.Forms.PresentationObjects;
+
+namespace Ringtoets.Common.Forms.Test.PresentationObjects
+{
+ [TestFixture]
+ public class IllustrationPointContextTest
+ {
+ [Test]
+ public void Constructor_IllustationPointNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var node = new IllustrationPointNode(new TestFaultTreeIllustrationPoint());
+
+ // Call
+ TestDelegate test = () => new IllustrationPointContext(null, node, "", "");
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("illustrationPoint", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_IllustrationPointNodeNull_ThrowsArgumentNullException()
+ {
+ // Call
+ TestDelegate test = () => new IllustrationPointContext(new TestFaultTreeIllustrationPoint(), null, "", "");
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("illustrationPointNode", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_WindDirectionNameNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var node = new IllustrationPointNode(new TestFaultTreeIllustrationPoint());
+
+ // Call
+ TestDelegate test = () => new IllustrationPointContext(new TestFaultTreeIllustrationPoint(), node, null, "");
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("windDirectionName", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ClosingSituationNull_ThrowsArgumentNullException()
+ {
+ // Setup
+ var node = new IllustrationPointNode(new TestFaultTreeIllustrationPoint());
+
+ // Call
+ TestDelegate test = () => new IllustrationPointContext(new TestFaultTreeIllustrationPoint(), node, "", null);
+
+ // Assert
+ var exception = Assert.Throws(test);
+ Assert.AreEqual("closingSituation", exception.ParamName);
+ }
+
+ [Test]
+ public void Constructor_ValidParameters_ExpectedProperties()
+ {
+ // Setup
+ var node = new IllustrationPointNode(new TestFaultTreeIllustrationPoint());
+ const string windDirectionName = "wdn";
+ const string closingSituation = "cs";
+
+ // Call
+ var context = new IllustrationPointContext((FaultTreeIllustrationPoint) node.Data, node,
+ windDirectionName, closingSituation);
+
+ // Assert
+ Assert.AreSame(node.Data, context.IllustrationPoint);
+ Assert.AreSame(node, context.IllustrationPointNode);
+ Assert.AreEqual(windDirectionName, context.WindDirectionName);
+ Assert.AreEqual(closingSituation, context.ClosingSituation);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj
===================================================================
diff -u -rb2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision b2db9fb09d24ef2b0c09ec1d90014c86b4f6ebcb)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -92,7 +92,7 @@
-
+
Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/GeneralResultFaultTreeIllustrationPointViewTest.cs
===================================================================
diff -u -ra9b29f48534f9e3e2ab82dce7b81cfe13df515e2 -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/GeneralResultFaultTreeIllustrationPointViewTest.cs (.../GeneralResultFaultTreeIllustrationPointViewTest.cs) (revision a9b29f48534f9e3e2ab82dce7b81cfe13df515e2)
+++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/GeneralResultFaultTreeIllustrationPointViewTest.cs (.../GeneralResultFaultTreeIllustrationPointViewTest.cs) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -496,7 +496,7 @@
TopLevelFaultTreeIllustrationPoint topLevel = generalResultFunc.TopLevelIllustrationPoints.First();
IllustrationPointNode expectedSelectedNode = topLevel.FaultTreeNodeRoot;
- var selectedFaultTreeContext = view.Selection as IllustrationPointNodeContext;
+ var selectedFaultTreeContext = view.Selection as IllustrationPointContext;
Assert.IsNotNull(selectedFaultTreeContext);
Assert.AreSame(expectedSelectedNode, selectedFaultTreeContext.IllustrationPointNode);
@@ -544,7 +544,7 @@
TopLevelFaultTreeIllustrationPoint topLevel = generalResultFunc.TopLevelIllustrationPoints.ElementAt(0);
IllustrationPointNode expectedSelectedNode = topLevel.FaultTreeNodeRoot.Children.First();
- var selectedSubMechanismContext = view.Selection as IllustrationPointNodeContext;
+ var selectedSubMechanismContext = view.Selection as IllustrationPointContext;
Assert.IsNotNull(selectedSubMechanismContext);
Assert.AreSame(expectedSelectedNode, selectedSubMechanismContext.IllustrationPointNode);
Assert.AreEqual(sameClosingSituations
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r2e944cbf52d124fd501ed4ed8e991aa50299cc69 -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 2e944cbf52d124fd501ed4ed8e991aa50299cc69)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -48,7 +48,6 @@
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
-using Ringtoets.Common.Data.IllustrationPoints;
using Ringtoets.Common.Data.Structures;
using Ringtoets.Common.Forms.ChangeHandlers;
using Ringtoets.Common.Forms.GuiServices;
@@ -111,6 +110,7 @@
using RingtoetsIntegrationPluginResources = Ringtoets.Integration.Plugin.Properties.Resources;
using BaseResources = Core.Common.Base.Properties.Resources;
using GuiResources = Core.Common.Gui.Properties.Resources;
+using Ringtoets.Common.Data.IllustrationPoints;
namespace Ringtoets.Integration.Plugin
{
@@ -334,10 +334,18 @@
{
CreateInstance = CreateTopLevelFaultTreeIllustrationPointProperties
};
- yield return new PropertyInfo
+ yield return new PropertyInfo, FaultTreeIllustrationPointProperties>
{
- CreateInstance = CreateIllustrationPointProperties
+ CreateInstance = context => new FaultTreeIllustrationPointProperties(context.IllustrationPointNode,
+ context.WindDirectionName,
+ context.ClosingSituation)
};
+ yield return new PropertyInfo, SubMechanismIllustrationPointProperties>
+ {
+ CreateInstance = context => new SubMechanismIllustrationPointProperties(context.IllustrationPointNode,
+ context.WindDirectionName,
+ context.ClosingSituation)
+ };
}
///
@@ -859,28 +867,6 @@
#region PropertyInfos
- private static IllustrationPointProperties CreateIllustrationPointProperties(IllustrationPointNodeContext context)
- {
- IllustrationPointNode illustrationPointNode = context.IllustrationPointNode;
-
- if (illustrationPointNode.Data is FaultTreeIllustrationPoint)
- {
- return new FaultTreeIllustrationPointProperties(illustrationPointNode,
- context.WindDirectionName,
- context.ClosingSituation);
- }
- if (illustrationPointNode.Data is SubMechanismIllustrationPoint)
- {
- return new SubMechanismIllustrationPointProperties(illustrationPointNode,
- context.WindDirectionName,
- context.ClosingSituation);
- }
-
- return new IllustrationPointProperties(illustrationPointNode,
- context.WindDirectionName,
- context.ClosingSituation);
- }
-
private static TopLevelFaultTreeIllustrationPointProperties CreateTopLevelFaultTreeIllustrationPointProperties(SelectedTopLevelFaultTreeIllustrationPoint point)
{
return new TopLevelFaultTreeIllustrationPointProperties(point.TopLevelFaultTreeIllustrationPoint,
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FaultTreeIllustrationPointContextPropertyInfoTest.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FaultTreeIllustrationPointContextPropertyInfoTest.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/FaultTreeIllustrationPointContextPropertyInfoTest.cs (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -0,0 +1,76 @@
+// 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.Linq;
+using Core.Common.Gui.Plugin;
+using Core.Common.Gui.PropertyBag;
+using NUnit.Framework;
+using Ringtoets.Common.Data.IllustrationPoints;
+using Ringtoets.Common.Data.TestUtil.IllustrationPoints;
+using Ringtoets.Common.Forms.PresentationObjects;
+using Ringtoets.Common.Forms.PropertyClasses;
+
+namespace Ringtoets.Integration.Plugin.Test.PropertyInfos
+{
+ [TestFixture]
+ public class FaultTreeIllustrationPointContextPropertyInfoTest
+ {
+ private RingtoetsPlugin plugin;
+ private PropertyInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new RingtoetsPlugin();
+ info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(FaultTreeIllustrationPointProperties));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Assert
+ Assert.AreEqual(typeof(IllustrationPointContext), info.DataType);
+ Assert.AreEqual(typeof(FaultTreeIllustrationPointProperties), info.PropertyObjectType);
+ }
+
+ [Test]
+ public void CreateInstance_ValidArguments_ReturnFaultTreeIllustrationPointBaseProperties()
+ {
+ // Setup
+ var illustrationPointNode = new IllustrationPointNode(new TestFaultTreeIllustrationPoint());
+ var context = new IllustrationPointContext((FaultTreeIllustrationPoint) illustrationPointNode.Data,
+ illustrationPointNode, "Wind direction", "Closing situation");
+
+ // Call
+ IObjectProperties objectProperties = info.CreateInstance(context);
+
+ // Assert
+ Assert.IsInstanceOf(objectProperties);
+ Assert.AreSame(illustrationPointNode, objectProperties.Data);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 68ad4c0477e2ae7f325fef005b88d5be5c563840 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/IllustrationPointNodeSubMechanismContextPropertyInfoTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SubMechanismIllustrationPointContextPropertyInfoTest.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SubMechanismIllustrationPointContextPropertyInfoTest.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/SubMechanismIllustrationPointContextPropertyInfoTest.cs (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -0,0 +1,77 @@
+// 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.Linq;
+using Core.Common.Gui.Plugin;
+using Core.Common.Gui.PropertyBag;
+using NUnit.Framework;
+using Ringtoets.Common.Data.IllustrationPoints;
+using Ringtoets.Common.Data.TestUtil.IllustrationPoints;
+using Ringtoets.Common.Forms.PresentationObjects;
+using Ringtoets.Common.Forms.PropertyClasses;
+
+namespace Ringtoets.Integration.Plugin.Test.PropertyInfos
+{
+ [TestFixture]
+ public class SubMechanismIllustrationPointContextPropertyInfoTest
+ {
+ private RingtoetsPlugin plugin;
+ private PropertyInfo info;
+
+ [SetUp]
+ public void SetUp()
+ {
+ plugin = new RingtoetsPlugin();
+ info = plugin.GetPropertyInfos().First(tni => tni.PropertyObjectType == typeof(SubMechanismIllustrationPointProperties));
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ plugin.Dispose();
+ }
+
+ [Test]
+ public void Initialized_Always_ExpectedPropertiesSet()
+ {
+ // Assert
+ Assert.AreEqual(typeof(IllustrationPointContext), info.DataType);
+ Assert.AreEqual(typeof(SubMechanismIllustrationPointProperties), info.PropertyObjectType);
+ }
+
+ [Test]
+ public void CreateInstance_ValidArguments_ReturnFaultTreeIllustrationPointBaseProperties()
+ {
+ // Setup
+ var illustrationPointNode = new IllustrationPointNode(new TestSubMechanismIllustrationPoint());
+ var context = new IllustrationPointContext(
+ (SubMechanismIllustrationPoint) illustrationPointNode.Data,
+ illustrationPointNode, "Wind direction", "Closing situation");
+
+ // Call
+ IObjectProperties objectProperties = info.CreateInstance(context);
+
+ // Assert
+ Assert.IsInstanceOf(objectProperties);
+ Assert.AreSame(illustrationPointNode, objectProperties.Data);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj
===================================================================
diff -u -ra1fa1538918813373bcc864f0bce092bf28fd0ce -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision a1fa1538918813373bcc864f0bce092bf28fd0ce)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -85,7 +85,8 @@
-
+
+
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs
===================================================================
diff -u -r36d3f041dd6f35e62c53b3d1b95bcd4171aa38b1 -r68ad4c0477e2ae7f325fef005b88d5be5c563840
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 36d3f041dd6f35e62c53b3d1b95bcd4171aa38b1)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 68ad4c0477e2ae7f325fef005b88d5be5c563840)
@@ -45,6 +45,7 @@
using Ringtoets.Common.Data.DikeProfiles;
using Ringtoets.Common.Data.FailureMechanism;
using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.IllustrationPoints;
using Ringtoets.Common.Data.Structures;
using Ringtoets.Common.Forms.PresentationObjects;
using Ringtoets.Common.Forms.PropertyClasses;
@@ -204,7 +205,7 @@
PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray();
// Assert
- Assert.AreEqual(18, propertyInfos.Length);
+ Assert.AreEqual(19, propertyInfos.Length);
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
@@ -293,8 +294,13 @@
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
- typeof(IllustrationPointNodeContext),
- typeof(IllustrationPointProperties));
+ typeof(IllustrationPointContext),
+ typeof(FaultTreeIllustrationPointProperties));
+
+ PluginTestHelper.AssertPropertyInfoDefined(
+ propertyInfos,
+ typeof(IllustrationPointContext),
+ typeof(SubMechanismIllustrationPointProperties));
}
}