Index: Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocationOutput.cs =================================================================== diff -u -r2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocationOutput.cs (.../HydraulicBoundaryLocationOutput.cs) (revision 2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Hydraulics/HydraulicBoundaryLocationOutput.cs (.../HydraulicBoundaryLocationOutput.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -113,9 +113,10 @@ } /// - /// Sets the general result with the sub mechanism illustration points. + /// Sets the general result of this output with the sub mechanism illustration points. /// - /// + /// The general result which + /// belongs to this output. /// Thrown when /// is null. public void SetIllustrationPoints(GeneralResult generalResultSubMechanismIllustrationPoint) Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probability/ProbabilityAssessmentOutput.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/src/Ringtoets.Common.Data/Probability/ProbabilityAssessmentOutput.cs (.../ProbabilityAssessmentOutput.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probability/ProbabilityAssessmentOutput.cs (.../ProbabilityAssessmentOutput.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -23,6 +23,7 @@ using Core.Common.Base; using Core.Common.Base.Data; using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Data.IllustrationPoints; namespace Ringtoets.Common.Data.Probability { @@ -103,5 +104,38 @@ /// Gets the factor of safety of the failure mechanism. /// public RoundedDouble FactorOfSafety { get; private set; } + + /// + /// Gets the value indicating whether the output contains illustration points. + /// + public bool HasIllustrationPoints + { + get + { + return GeneralFaultTreeIllustrationPoint != null; + } + } + + /// + /// Gets the general result with the fault tree illustration points. + /// + public GeneralResult GeneralFaultTreeIllustrationPoint { get; private set; } + + /// + /// Sets the general result of this output with the fault tree illustration points. + /// + /// The general result which belongs + /// to this output. + /// Thrown when + /// is null. + public void SetIllustrationPoints(GeneralResult generalResultFaultTreeIllustrationPoint) + { + if (generalResultFaultTreeIllustrationPoint == null) + { + throw new ArgumentNullException(nameof(generalResultFaultTreeIllustrationPoint)); + } + + GeneralFaultTreeIllustrationPoint = generalResultFaultTreeIllustrationPoint; + } } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresOutput.cs =================================================================== diff -u -r5f40a81ccc0990cb8cdaf7776608e56a7fdae72c -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresOutput.cs (.../StructuresOutput.cs) (revision 5f40a81ccc0990cb8cdaf7776608e56a7fdae72c) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Structures/StructuresOutput.cs (.../StructuresOutput.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -45,6 +45,9 @@ ProbabilityAssessmentOutput = probabilityAssessmentOutput; } + /// + /// Gets the probabilistic assessment output. + /// public ProbabilityAssessmentOutput ProbabilityAssessmentOutput { get; } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresOutputTest.cs =================================================================== diff -u -r5f40a81ccc0990cb8cdaf7776608e56a7fdae72c -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresOutputTest.cs (.../StructuresOutputTest.cs) (revision 5f40a81ccc0990cb8cdaf7776608e56a7fdae72c) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresOutputTest.cs (.../StructuresOutputTest.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -23,6 +23,7 @@ using NUnit.Framework; using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; namespace Ringtoets.Common.Data.Test.Structures { @@ -62,6 +63,47 @@ // Assert Assert.AreSame(output, structuresOutput.ProbabilityAssessmentOutput); + Assert.IsFalse(output.HasIllustrationPoints); } + + [Test] + public void SetIllustrationPoints_GeneralResultNull_ThrowsArgumentNullException() + { + // Setup + var random = new Random(21); + var output = new ProbabilityAssessmentOutput(random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + random.NextDouble()); + + // Call + TestDelegate call = () => output.SetIllustrationPoints(null) ; + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("generalResultFaultTreeIllustrationPoint", exception.ParamName); + } + + [Test] + public void SetIllustrationPoints_ValidGeneralResult_SetExpectedProperties() + { + // Setup + var generalResult = new TestGeneralResultFaultTreeIllustrationPoint(); + + var random = new Random(21); + var output = new ProbabilityAssessmentOutput(random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + random.NextDouble()); + + // Call + output.SetIllustrationPoints(generalResult); + + // Assert + Assert.AreSame(generalResult, output.GeneralFaultTreeIllustrationPoint); + Assert.IsTrue(output.HasIllustrationPoints); + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPointTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPointTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPointTest.cs (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -0,0 +1,50 @@ +// 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 NUnit.Framework; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; + +namespace Ringtoets.Common.Data.TestUtil.Test.IllustrationPoints +{ + [TestFixture] + public class TestGeneralResultFaultTreeIllustrationPointTest + { + [Test] + public void Constructor_ReturnsExpectedElements() + { + // Call + var generalResult = new TestGeneralResultFaultTreeIllustrationPoint(); + + // Assert + Assert.IsInstanceOf>(generalResult); + AssertWindDirection(WindDirectionTestFactory.CreateTestWindDirection(), generalResult.GoverningWindDirection); + CollectionAssert.IsEmpty(generalResult.Stochasts); + CollectionAssert.IsEmpty(generalResult.TopLevelIllustrationPoints); + } + + private static void AssertWindDirection(WindDirection expected, WindDirection actual) + { + Assert.AreEqual(expected.Name, actual.Name); + Assert.AreEqual(expected.Angle, actual.Angle); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs =================================================================== diff -u -r2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs (.../TestGeneralResultSubMechanismIllustrationPointTest.cs) (revision 2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPointTest.cs (.../TestGeneralResultSubMechanismIllustrationPointTest.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -62,11 +62,6 @@ private static void AssertWindDirection(WindDirection expected, WindDirection actual) { - if (expected == null) - { - Assert.IsNull(actual); - return; - } Assert.AreEqual(expected.Name, actual.Name); Assert.AreEqual(expected.Angle, actual.Angle); } Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj =================================================================== diff -u -rb97480db064df3dd0a522a60a3552e1a2117e6d6 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision b97480db064df3dd0a522a60a3552e1a2117e6d6) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -55,6 +55,7 @@ + Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPoint.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPoint.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultFaultTreeIllustrationPoint.cs (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -0,0 +1,41 @@ +// 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 Ringtoets.Common.Data.IllustrationPoints; + +namespace Ringtoets.Common.Data.TestUtil.IllustrationPoints +{ + /// + /// A simple general result with top level fault tree illustration point that + /// can be used for testing. + /// + public class TestGeneralResultFaultTreeIllustrationPoint : GeneralResult + { + /// + /// Create a new instance of . + /// + public TestGeneralResultFaultTreeIllustrationPoint() + : base(WindDirectionTestFactory.CreateTestWindDirection(), + Enumerable.Empty(), + Enumerable.Empty()) {} + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPoint.cs =================================================================== diff -u -r2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPoint.cs (.../TestGeneralResultSubMechanismIllustrationPoint.cs) (revision 2e5f2b59e81cda48f3d7ee03afa4db88abc7b1a8) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/IllustrationPoints/TestGeneralResultSubMechanismIllustrationPoint.cs (.../TestGeneralResultSubMechanismIllustrationPoint.cs) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -27,7 +27,8 @@ namespace Ringtoets.Common.Data.TestUtil.IllustrationPoints { /// - /// A simple general result which can be used for testing. + /// A simple general result with top level sub mechanism illustration points + /// which can be used for testing. /// public class TestGeneralResultSubMechanismIllustrationPoint : GeneralResult { Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj =================================================================== diff -u -rfee74e8fb98844af091f9b061d9470540dfdd6f0 -rb980005d38347be63445eae4223e5d9fa2dc0395 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision fee74e8fb98844af091f9b061d9470540dfdd6f0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision b980005d38347be63445eae4223e5d9fa2dc0395) @@ -58,6 +58,7 @@ +