Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs =================================================================== diff -u -r4afb3d635232a5570c867f890f2c8b4f973ea7f7 -r88db4d493b026e3f5bb083d1bb33bc607ff0d63e --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs) (revision 4afb3d635232a5570c867f890f2c8b4f973ea7f7) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilLayerTwoDEntityReadExtensionsTest.cs) (revision 88db4d493b026e3f5bb083d1bb33bc607ff0d63e) @@ -23,6 +23,8 @@ using System.Drawing; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read.MacroStabilityInwards; +using Application.Ringtoets.Storage.Serializers; +using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.MacroStabilityInwards.Primitives; @@ -67,6 +69,20 @@ double popMean = random.NextDouble(); double popCoefficientOfVariation = random.NextDouble(); + var outerRingPoints = new[] + { + CreateRandomPoint2D(random), + CreateRandomPoint2D(random), + CreateRandomPoint2D(random), + CreateRandomPoint2D(random) + }; + var holes = new[] + { + CreateRandomRing(random), + CreateRandomRing(random), + CreateRandomRing(random) + }; + var entity = new MacroStabilityInwardsSoilLayerTwoDEntity { IsAquifer = Convert.ToByte(isAquifer), @@ -93,7 +109,10 @@ StrengthIncreaseExponentCoefficientOfVariation = strengthIncreaseExponentCoefficientOfVariation, PopMean = popMean, - PopCoefficientOfVariation = popCoefficientOfVariation + PopCoefficientOfVariation = popCoefficientOfVariation, + + OuterRingXml = new Point2DXmlSerializer().ToXml(outerRingPoints), + HolesXml = new RingXmlSerializer().ToXml(holes) }; // Call @@ -128,6 +147,9 @@ Assert.AreEqual(popMean, properties.PopMean); Assert.AreEqual(popCoefficientOfVariation, properties.PopCoefficientOfVariation); + + Assert.AreEqual(outerRingPoints, layer.OuterRing.Points); + CollectionAssert.AreEqual(holes, layer.Holes); } [Test] @@ -136,7 +158,9 @@ // Setup var entity = new MacroStabilityInwardsSoilLayerTwoDEntity { - MaterialName = nameof(MacroStabilityInwardsSoilLayerTwoDEntity) + MaterialName = nameof(MacroStabilityInwardsSoilLayerTwoDEntity), + OuterRingXml = new Point2DXmlSerializer().ToXml(CreateRandomRing(new Random(31)).Points), + HolesXml = new RingXmlSerializer().ToXml(new Ring[0]) }; // Call @@ -170,5 +194,19 @@ Assert.IsNaN(properties.PopMean); Assert.IsNaN(properties.PopCoefficientOfVariation); } + + private static Ring CreateRandomRing(Random random) + { + return new Ring(new[] + { + CreateRandomPoint2D(random), + CreateRandomPoint2D(random) + }); + } + + private static Point2D CreateRandomPoint2D(Random random) + { + return new Point2D(random.NextDouble(), random.NextDouble()); + } } } \ No newline at end of file