Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelFaultTreeIllustrationPointPropertiesTest.cs =================================================================== diff -u -rc072c430cf3193c3ada31a81bd0cd4e75f4a068a -r390c486bb4cd693ae2f2eaf82a30efcb51480048 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelFaultTreeIllustrationPointPropertiesTest.cs (.../TopLevelFaultTreeIllustrationPointPropertiesTest.cs) (revision c072c430cf3193c3ada31a81bd0cd4e75f4a068a) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/TopLevelFaultTreeIllustrationPointPropertiesTest.cs (.../TopLevelFaultTreeIllustrationPointPropertiesTest.cs) (revision 390c486bb4cd693ae2f2eaf82a30efcb51480048) @@ -44,7 +44,7 @@ private const int illustrationPointPropertyIndex = 6; [Test] - public void Constructor_FaultTreeNull_ThrowsException() + public void Constructor_FaultTreeNull_ThrowsArgumentNullException() { // Call TestDelegate test = () => new TopLevelFaultTreeIllustrationPointProperties(null, new[] @@ -53,12 +53,12 @@ }); // Assert - const string expectedMessage = "Value cannot be null."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("faultTreeData", paramName); } [Test] - public void Constructor_ClosingSituationsNull_ThrowsException() + public void Constructor_ClosingSituationsNull_ThrowsArgumentNullException() { // Setup var topLevel = new TopLevelFaultTreeIllustrationPoint( @@ -70,8 +70,8 @@ TestDelegate test = () => new TopLevelFaultTreeIllustrationPointProperties(topLevel, null); // Assert - const string expectedMessage = "Value cannot be null."; - TestHelper.AssertThrowsArgumentExceptionAndTestMessage(test, expectedMessage); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("allClosingSituations", paramName); } [Test] @@ -81,10 +81,13 @@ var topLevel = new TopLevelFaultTreeIllustrationPoint( new WindDirection("N", 5.0), "closing situation", - new IllustrationPointNode(new TestFaultTreeIllustrationPoint(new[] - { - new Stochast("Stochast A", 2.5, 5.5) - }))); + new IllustrationPointNode(new FaultTreeIllustrationPoint("Fault Tree A", + 3.14, + new[] + { + new Stochast("Stochast A", 2.5, 5.5) + }, + CombinationType.And))); topLevel.FaultTreeNodeRoot.SetChildren(new[] { @@ -116,13 +119,19 @@ nameof(TopLevelFaultTreeIllustrationPointProperties.AlphaValues)); Assert.IsNotNull(faultTree.AlphaValues); Assert.AreEqual(1, faultTree.AlphaValues.Length); - Assert.AreEqual(5.5, faultTree.AlphaValues[0].Alpha); + foreach (Stochast alpha in faultTree.AlphaValues) + { + Assert.AreEqual(5.5, alpha.Alpha); + } TestHelper.AssertTypeConverter( nameof(TopLevelFaultTreeIllustrationPointProperties.Durations)); Assert.IsNotNull(faultTree.Durations); Assert.AreEqual(1, faultTree.Durations.Length); - Assert.AreEqual(2.5, faultTree.Durations[0].Duration); + foreach (Stochast duration in faultTree.Durations) + { + Assert.AreEqual(2.5, duration.Duration); + } TestHelper.AssertTypeConverter( nameof(TopLevelFaultTreeIllustrationPointProperties.IllustrationPoints)); @@ -131,7 +140,7 @@ } [Test] - public void Constructor_NoUniqueClosingSituations_PropertiesHaveExpectedAttributesValues() + public void Constructor_UniqueClosingSituations_PropertiesHaveExpectedAttributesValues() { // Setup var topLevel = new TopLevelFaultTreeIllustrationPoint( @@ -195,7 +204,7 @@ } [Test] - public void Constructor_UniqueClosingSituations_PropertiesHaveExpectedAttributesValues() + public void Constructor_NoUniqueClosingSituations_PropertiesHaveExpectedAttributesValues() { // Setup var topLevel = new TopLevelFaultTreeIllustrationPoint( @@ -275,10 +284,7 @@ "closing situation", new IllustrationPointNode(new TestFaultTreeIllustrationPoint())); - var topLevelFaultTreeProperties = new TopLevelFaultTreeIllustrationPointProperties(topLevelFaultTreeIllustrationPoint, new[] - { - "closing situation" - }); + var topLevelFaultTreeProperties = new TopLevelFaultTreeIllustrationPointProperties(topLevelFaultTreeIllustrationPoint, new string[0]); // Call string toString = topLevelFaultTreeProperties.ToString();