Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs =================================================================== diff -u -r81fa8a9bf3bd503cbd280e88b8f6037a840cff12 -r3cf4d4c65cf2ce285bdeb71162cf3b0a79cb3742 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs (.../PipingOutputTest.cs) (revision 81fa8a9bf3bd503cbd280e88b8f6037a840cff12) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingOutputTest.cs (.../PipingOutputTest.cs) (revision 3cf4d4c65cf2ce285bdeb71162cf3b0a79cb3742) @@ -24,6 +24,8 @@ using NUnit.Framework; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.TestUtil; +using CoreCloneAssert = Core.Common.Data.TestUtil.CloneAssert; +using PipingCloneAssert = Ringtoets.Piping.Data.TestUtil.CloneAssert; namespace Ringtoets.Piping.Data.Test { @@ -94,6 +96,7 @@ Assert.IsInstanceOf(output); Assert.IsInstanceOf(output); + Assert.IsInstanceOf(output); Assert.AreEqual(zuValue, output.UpliftZValue); Assert.AreEqual(foSuValue, output.UpliftFactorOfSafety); @@ -113,5 +116,43 @@ Assert.AreEqual(2, output.SellmeijerReducedFall.NumberOfDecimalPlaces); Assert.AreEqual(sellmeijerReducedFall, output.SellmeijerReducedFall, output.SellmeijerReducedFall.GetAccuracy()); } + + [Test] + public void Clone_AllPropertiesSet_ReturnNewInstanceWithCopiedValues() + { + // Setup + var original = GetRandomPipingOutput(); + + // Call + object clone = original.Clone(); + + // Assert + CoreCloneAssert.AreObjectClones(original, clone, PipingCloneAssert.AreClones); + } + + private PipingOutput GetRandomPipingOutput() + { + var random = new Random(22); + double zuValue = random.NextDouble(); + double foSuValue = random.NextDouble(); + double zhValue = random.NextDouble(); + double foShValue = random.NextDouble(); + double zsValue = random.NextDouble(); + double foSsValue = random.NextDouble(); + double upliftEffectiveStress = random.NextDouble(); + double heaveGradient = random.NextDouble(); + + return new PipingOutput(new PipingOutput.ConstructionProperties + { + UpliftZValue = zuValue, + UpliftFactorOfSafety = foSuValue, + HeaveZValue = zhValue, + HeaveFactorOfSafety = foShValue, + SellmeijerZValue = zsValue, + SellmeijerFactorOfSafety = foSsValue, + UpliftEffectiveStress = upliftEffectiveStress, + HeaveGradient = heaveGradient + }); + } } } \ No newline at end of file