Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -race7d480d3fd3d7b3ce7260ca32b04fe3e1863c7 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision ace7d480d3fd3d7b3ce7260ca32b04fe3e1863c7) @@ -61,6 +61,7 @@ + Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationOutputTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationOutputTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestHydraulicBoundaryLocationOutputTest.cs (revision ace7d480d3fd3d7b3ce7260ca32b04fe3e1863c7) @@ -0,0 +1,68 @@ +// Copyright (C) Stichting Deltares 2016. 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.Hydraulics; + +namespace Ringtoets.Common.Data.TestUtil.Test +{ + [TestFixture] + public class TestHydraulicBoundaryLocationOutputTest + { + [Test] + public void TestHydraulicBoundaryLocationOutput_WithoutConvergence_ReturnsExpectedValues() + { + // Setup + const double result = 9.0; + + // Call + HydraulicBoundaryLocationOutput output = new TestHydraulicBoundaryLocationOutput(result); + + // Assert + Assert.AreEqual(result, output.Result, output.Result.GetAccuracy()); + Assert.IsNaN(output.TargetProbability); + Assert.IsNaN(output.TargetReliability); + Assert.IsNaN(output.CalculatedProbability); + Assert.IsNaN(output.CalculatedReliability); + Assert.AreEqual(CalculationConvergence.NotCalculated, output.CalculationConvergence); + } + + [Test] + public void TestHydraulicBoundaryLocationOutput_WithConvergence_ReturnsExpectedValues( + [Values(CalculationConvergence.CalculatedConverged, CalculationConvergence.NotCalculated, + CalculationConvergence.CalculatedNotConverged)] CalculationConvergence convergence) + { + // Setup + const double result = 9.5; + + // Call + HydraulicBoundaryLocationOutput output = new TestHydraulicBoundaryLocationOutput(result, convergence); + + // Assert + Assert.AreEqual(result, output.Result, output.Result.GetAccuracy()); + Assert.IsNaN(output.TargetProbability); + Assert.IsNaN(output.TargetReliability); + Assert.IsNaN(output.CalculatedProbability); + Assert.IsNaN(output.CalculatedReliability); + Assert.AreEqual(convergence, output.CalculationConvergence); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -race7d480d3fd3d7b3ce7260ca32b04fe3e1863c7 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision ace7d480d3fd3d7b3ce7260ca32b04fe3e1863c7) @@ -39,8 +39,8 @@ + False ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll - True ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll @@ -63,6 +63,7 @@ + Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocationOutput.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocationOutput.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestHydraulicBoundaryLocationOutput.cs (revision ace7d480d3fd3d7b3ce7260ca32b04fe3e1863c7) @@ -0,0 +1,40 @@ +// Copyright (C) Stichting Deltares 2016. 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 Ringtoets.Common.Data.Hydraulics; + +namespace Ringtoets.Common.Data.TestUtil +{ + /// + /// Class which creates simple instances of , + /// which can be used during testing. + /// + public class TestHydraulicBoundaryLocationOutput : HydraulicBoundaryLocationOutput + { + /// + /// Creates a new instance of . + /// + /// The result to set in the output. + /// The to set in the output. + public TestHydraulicBoundaryLocationOutput(double result, CalculationConvergence calculationConvergence = CalculationConvergence.NotCalculated) : + base(result, double.NaN, double.NaN, double.NaN, double.NaN, calculationConvergence) {} + } +} \ No newline at end of file