Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs =================================================================== diff -u -rfe90a6d174a01975381e6cda55ed1f7f4e831a51 -r30acee98189fbeafc6e25025d14781ce84750a67 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs (.../GeneralResultTest.cs) (revision fe90a6d174a01975381e6cda55ed1f7f4e831a51) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/IllustrationPoints/GeneralResultTest.cs (.../GeneralResultTest.cs) (revision 30acee98189fbeafc6e25025d14781ce84750a67) @@ -25,6 +25,8 @@ using NUnit.Framework; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using CoreCloneAssert = Core.Common.Data.TestUtil.CloneAssert; +using CommonCloneAssert = Ringtoets.Common.Data.TestUtil.CloneAssert; namespace Ringtoets.Common.Data.Test.IllustrationPoints { @@ -94,9 +96,38 @@ topLevelIllustrationPoints); // Assert + Assert.IsInstanceOf(generalResult); Assert.AreSame(windDirection, generalResult.GoverningWindDirection); Assert.AreSame(topLevelIllustrationPoints, generalResult.TopLevelIllustrationPoints); Assert.AreSame(stochasts, generalResult.Stochasts); } + + [Test] + public void Clone_Always_ReturnNewInstanceWithCopiedValues() + { + // Setup + var random = new Random(21); + var original = new GeneralResult(WindDirectionTestFactory.CreateTestWindDirection(), + new[] + { + new Stochast("Random name 1", + random.NextDouble(), + random.NextDouble()), + new Stochast("Random name 2", + random.NextDouble(), + random.NextDouble()) + }, + new[] + { + new TestTopLevelIllustrationPoint(), + new TestTopLevelIllustrationPoint() + }); + + // Call + object clone = original.Clone(); + + // Assert + CoreCloneAssert.AreClones(original, clone, CommonCloneAssert.AreClones); + } } } \ No newline at end of file