Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs =================================================================== diff -u -r71120734f3b9d5c38815221bb43be01eb2aa56b7 -r390c486bb4cd693ae2f2eaf82a30efcb51480048 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs (.../IllustrationPointPropertiesTest.cs) (revision 71120734f3b9d5c38815221bb43be01eb2aa56b7) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/IllustrationPointPropertiesTest.cs (.../IllustrationPointPropertiesTest.cs) (revision 390c486bb4cd693ae2f2eaf82a30efcb51480048) @@ -21,6 +21,7 @@ using System; using System.ComponentModel; +using System.Linq; using Core.Common.Gui.Converters; using Core.Common.TestUtil; using Core.Common.Utils; @@ -44,25 +45,25 @@ private const int illustrationPointPropertyIndex = 4; [Test] - public void Constructor_IllustrationPointNodeNull_ThrowsException() + public void Constructor_IllustrationPointNodeNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new IllustrationPointProperties(null, "Point name A", "Closing Situation"); // Assert - const string expectedMessage = "Value cannot be null."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("illustrationPointNode", paramName); } [Test] - public void Constructor_WindDirectionNull_ThrowsException() + public void Constructor_WindDirectionNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new IllustrationPointProperties(new IllustrationPointNode(new TestIllustrationPoint()), null, "Closing Situation"); // Assert - const string expectedMessage = "Value cannot be null."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("windDirection", paramName); } [Test] @@ -72,15 +73,18 @@ TestDelegate test = () => new IllustrationPointProperties(new IllustrationPointNode(new TestIllustrationPoint()), "SE", null); // Assert - const string expectedMessage = "Value cannot be null."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("closingSituation", paramName); } [Test] public void Constructor_FaultTreeIllustrationPointWithoutChildren_CorrectValues() { // Call - var faultTree = new IllustrationPointProperties(new IllustrationPointNode(new TestFaultTreeIllustrationPoint()), "NNE", "closing situation"); + var faultTree = new IllustrationPointProperties(new IllustrationPointNode(new FaultTreeIllustrationPoint("Fault Tree AAA", + 3.14, + Enumerable.Empty(), + CombinationType.And)), "NNE", "closing situation"); // Assert Assert.AreEqual("NNE", faultTree.WindDirection); @@ -105,11 +109,20 @@ public void Constructor_FaultTreeIllustrationPointWithChildren_CorrectValues() { // Setup - var illustrationPointNode = new IllustrationPointNode(new TestSubMechanismIllustrationPoint()); + var illustrationPointNode = new IllustrationPointNode(new SubMechanismIllustrationPoint("NNE", + 3.14, + Enumerable.Empty(), + Enumerable.Empty())); illustrationPointNode.SetChildren(new[] { - new IllustrationPointNode(new TestFaultTreeIllustrationPoint()), - new IllustrationPointNode(new TestSubMechanismIllustrationPoint()) + new IllustrationPointNode(new FaultTreeIllustrationPoint("Fault Tree A", + 3.14, + Enumerable.Empty(), + CombinationType.And)), + new IllustrationPointNode(new SubMechanismIllustrationPoint("Sub Mechanism B", + 4.2, + Enumerable.Empty(), + Enumerable.Empty())) }); // Call @@ -207,6 +220,7 @@ { // Setup var illustrationPointNode = new IllustrationPointNode(new TestSubMechanismIllustrationPoint()); + // Call var faultTree = new IllustrationPointProperties(illustrationPointNode, "N", "Closing Situation");