Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs =================================================================== diff -u -rff51075f9bb18ac60d0ab4de5aa50dc87fe73554 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs (.../MacroStabilityInwardsSurfaceLineCreateExtensions.cs) (revision ff51075f9bb18ac60d0ab4de5aa50dc87fe73554) +++ Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensions.cs (.../MacroStabilityInwardsSurfaceLineCreateExtensions.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -67,7 +67,7 @@ Name = surfaceLine.Name.DeepClone(), ReferenceLineIntersectionX = surfaceLine.ReferenceLineIntersectionWorldPoint?.X.ToNaNAsNull(), ReferenceLineIntersectionY = surfaceLine.ReferenceLineIntersectionWorldPoint?.Y.ToNaNAsNull(), - PointsXml = new Point3DXmlSerializer().ToXml(surfaceLine.Points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points), Order = order }; CreateCharacteristicPointEntities(surfaceLine, entity); Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs =================================================================== diff -u -rff51075f9bb18ac60d0ab4de5aa50dc87fe73554 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs (.../PipingSurfaceLineCreateExtensions.cs) (revision ff51075f9bb18ac60d0ab4de5aa50dc87fe73554) +++ Ringtoets/Storage/src/Ringtoets.Storage.Core/Create/Piping/PipingSurfaceLineCreateExtensions.cs (.../PipingSurfaceLineCreateExtensions.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -65,7 +65,7 @@ Name = surfaceLine.Name.DeepClone(), ReferenceLineIntersectionX = surfaceLine.ReferenceLineIntersectionWorldPoint?.X.ToNaNAsNull(), ReferenceLineIntersectionY = surfaceLine.ReferenceLineIntersectionWorldPoint?.Y.ToNaNAsNull(), - PointsXml = new Point3DXmlSerializer().ToXml(surfaceLine.Points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points), Order = order }; CreateCharacteristicPointEntities(surfaceLine, entity); Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs =================================================================== diff -u -rff51075f9bb18ac60d0ab4de5aa50dc87fe73554 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs (.../SurfaceLineEntityReadExtensions.cs) (revision ff51075f9bb18ac60d0ab4de5aa50dc87fe73554) +++ Ringtoets/Storage/src/Ringtoets.Storage.Core/Read/SurfaceLineEntityReadExtensions.cs (.../SurfaceLineEntityReadExtensions.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -298,7 +298,7 @@ /// Thrown when is empty. private static IEnumerable ReadGeometryPoints(string xml) { - return new Point3DXmlSerializer().FromXml(xml); + return new Point3DCollectionXmlSerializer().FromXml(xml); } } } \ No newline at end of file Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Ringtoets.Storage.Core.csproj =================================================================== diff -u -r4a30aea5c764fc20099bd2b42798590705555633 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/src/Ringtoets.Storage.Core/Ringtoets.Storage.Core.csproj (.../Ringtoets.Storage.Core.csproj) (revision 4a30aea5c764fc20099bd2b42798590705555633) +++ Ringtoets/Storage/src/Ringtoets.Storage.Core/Ringtoets.Storage.Core.csproj (.../Ringtoets.Storage.Core.csproj) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -426,7 +426,7 @@ - + Index: Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs =================================================================== diff -u --- Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs (revision 0) +++ Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point3DCollectionXmlSerializer.cs (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -0,0 +1,72 @@ +// 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; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using Core.Common.Base.Geometry; + +namespace Ringtoets.Storage.Core.Serializers +{ + /// + /// Converter class that converts between a collection of and an + /// XML representation of that data. + /// + internal class Point3DCollectionXmlSerializer : DataCollectionSerializer + { + protected override Point3D[] FromSerializableData(IEnumerable serializedElements) + { + return serializedElements.Select(sp => sp.ToPoint3D()).ToArray(); + } + + protected override SerializablePoint3D[] ToSerializableData(IEnumerable elements) + { + return elements.Select(p => new SerializablePoint3D(p)).ToArray(); + } + + [Serializable] + [DataContract(Name = nameof(SerializablePoint3D), Namespace = "")] + internal class SerializablePoint3D + { + [DataMember] + private readonly double x; + + [DataMember] + private readonly double y; + + [DataMember] + private readonly double z; + + public SerializablePoint3D(Point3D point3D) + { + x = point3D.X; + y = point3D.Y; + z = point3D.Z; + } + + public Point3D ToPoint3D() + { + return new Point3D(x, y, z); + } + } + } +} \ No newline at end of file Fisheye: Tag 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a refers to a dead (removed) revision in file `Ringtoets/Storage/src/Ringtoets.Storage.Core/Serializers/Point3DXmlSerializer.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensionsTest.cs =================================================================== diff -u -r27972af2e4d2d6af87d60f67fcb8345607b974ab -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensionsTest.cs (.../MacroStabilityInwardsSurfaceLineCreateExtensionsTest.cs) (revision 27972af2e4d2d6af87d60f67fcb8345607b974ab) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSurfaceLineCreateExtensionsTest.cs (.../MacroStabilityInwardsSurfaceLineCreateExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -85,7 +85,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(order, entity.Order); - string expectedXml = new Point3DXmlSerializer().ToXml(new Point3D[0]); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]); Assert.AreEqual(expectedXml, entity.PointsXml); } @@ -131,7 +131,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(order, entity.Order); - string expectedXml = new Point3DXmlSerializer().ToXml(surfaceLine.Points); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points); Assert.AreEqual(expectedXml, entity.PointsXml); } @@ -199,7 +199,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); - string expectedXml = new Point3DXmlSerializer().ToXml(geometry); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(geometry); Assert.AreEqual(expectedXml, entity.PointsXml); Assert.AreEqual(12, entity.MacroStabilityInwardsCharacteristicPointEntities.Count); @@ -310,7 +310,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); - string expectedXml = new Point3DXmlSerializer().ToXml(geometry); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(geometry); Assert.AreEqual(expectedXml, entity.PointsXml); Assert.AreEqual(12, entity.MacroStabilityInwardsCharacteristicPointEntities.Count); Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/Piping/PipingSurfaceLineCreateExtensionsTest.cs =================================================================== diff -u -r906ecf857f6fc95a33793d383493fb0201fe50fc -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/Piping/PipingSurfaceLineCreateExtensionsTest.cs (.../PipingSurfaceLineCreateExtensionsTest.cs) (revision 906ecf857f6fc95a33793d383493fb0201fe50fc) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Create/Piping/PipingSurfaceLineCreateExtensionsTest.cs (.../PipingSurfaceLineCreateExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -87,7 +87,7 @@ Assert.IsNull(entity.FailureMechanismEntity); IEnumerable points = new Point3D[0]; - string expectedXml = new Point3DXmlSerializer().ToXml(points); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(points); Assert.AreEqual(expectedXml, entity.PointsXml); } @@ -132,7 +132,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(order, entity.Order); - string expectedXml = new Point3DXmlSerializer().ToXml(surfaceLine.Points); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(surfaceLine.Points); Assert.AreEqual(expectedXml, entity.PointsXml); Assert.IsNull(entity.FailureMechanismEntity); @@ -181,7 +181,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); - string expectedXml = new Point3DXmlSerializer().ToXml(geometry); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(geometry); Assert.AreEqual(expectedXml, entity.PointsXml); Assert.AreEqual(6, entity.PipingCharacteristicPointEntities.Count); @@ -256,7 +256,7 @@ Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); - string expectedXml = new Point3DXmlSerializer().ToXml(geometry); + string expectedXml = new Point3DCollectionXmlSerializer().ToXml(geometry); Assert.AreEqual(expectedXml, entity.PointsXml); Assert.AreEqual(6, entity.PipingCharacteristicPointEntities.Count); Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs =================================================================== diff -u -r5a1e32bf0ca1dbbc967a1f6168abb94869105a64 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision 5a1e32bf0ca1dbbc967a1f6168abb94869105a64) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -568,7 +568,7 @@ // Setup AssessmentSectionEntity entity = CreateAssessmentSectionEntity(); - string emptyPointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]); + string emptyPointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]); const string surfaceLineSourcePath = "some/path"; var failureMechanismEntity = new FailureMechanismEntity { @@ -799,7 +799,7 @@ // Setup AssessmentSectionEntity entity = CreateAssessmentSectionEntity(); - string emptyPointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]); + string emptyPointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]); const string surfaceLineSourcePath = "some/path"; var failureMechanismEntity = new FailureMechanismEntity { Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/FailureMechanismEntityReadExtensionsTest.cs =================================================================== diff -u -r5a1e32bf0ca1dbbc967a1f6168abb94869105a64 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 5a1e32bf0ca1dbbc967a1f6168abb94869105a64) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -573,7 +573,7 @@ public void ReadAsPipingFailureMechanism_WithSurfaceLines_SetsPipingFailureMechanismSurfaceLines() { // Setup - string emptyPointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]); + string emptyPointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]); const string sourcePath = "some/path"; var entity = new FailureMechanismEntity { @@ -938,7 +938,7 @@ public void ReadAsMacroStabilityInwardsFailureMechanism_WithSurfaceLines_MacroStabilityInwardsFailureMechanismWithSurfaceLinesSet() { // Setup - string emptyPointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]); + string emptyPointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]); const string sourcePath = "some/path"; var entity = new FailureMechanismEntity { Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -r5a1e32bf0ca1dbbc967a1f6168abb94869105a64 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs (.../PipingCalculationEntityReadExtensionsTest.cs) (revision 5a1e32bf0ca1dbbc967a1f6168abb94869105a64) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/Piping/PipingCalculationEntityReadExtensionsTest.cs (.../PipingCalculationEntityReadExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -165,7 +165,7 @@ var surfaceLineEntity = new SurfaceLineEntity { Name = "surface line", - PointsXml = new Point3DXmlSerializer().ToXml(points) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points) }; var entity = new PipingCalculationEntity Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/SurfaceLineEntityReadExtensionsTest.cs =================================================================== diff -u -rcc1e01b564db25f17599d16757d4bb336d023862 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/SurfaceLineEntityReadExtensionsTest.cs (.../SurfaceLineEntityReadExtensionsTest.cs) (revision cc1e01b564db25f17599d16757d4bb336d023862) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Read/SurfaceLineEntityReadExtensionsTest.cs (.../SurfaceLineEntityReadExtensionsTest.cs) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -93,7 +93,7 @@ Name = "nice name!", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]) }; // Call @@ -133,7 +133,7 @@ Name = nameof(SurfaceLineEntity), ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points) }; // Call @@ -177,7 +177,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), PipingCharacteristicPointEntities = { CreatePipingCharacteristicPointEntity(points[1], PipingCharacteristicPointType.BottomDitchDikeSide), @@ -225,7 +225,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), PipingCharacteristicPointEntities = { CreatePipingCharacteristicPointEntity(points[0], PipingCharacteristicPointType.BottomDitchDikeSide), @@ -266,7 +266,7 @@ var entity = new SurfaceLineEntity { Name = "name", - PointsXml = new Point3DXmlSerializer().ToXml(new[] + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new[] { point3D }), @@ -315,7 +315,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), PipingCharacteristicPointEntities = { CreatePipingCharacteristicPointEntity(points[0], (PipingCharacteristicPointType) invalidCharacteristicPointType) @@ -340,7 +340,7 @@ var entity = new SurfaceLineEntity { Name = "surface line", - PointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]) }; // Call @@ -408,7 +408,7 @@ Name = "nice name!", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]) }; // Call @@ -454,7 +454,7 @@ Name = nameof(SurfaceLineEntity), ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points) }; // Call @@ -495,7 +495,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), MacroStabilityInwardsCharacteristicPointEntities = { CreateMacroStabilityInwardsCharacteristicPointEntity(points[0], MacroStabilityInwardsCharacteristicPointType.SurfaceLevelOutside), @@ -555,7 +555,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), MacroStabilityInwardsCharacteristicPointEntities = { CreateMacroStabilityInwardsCharacteristicPointEntity(points[0], MacroStabilityInwardsCharacteristicPointType.SurfaceLevelOutside), @@ -608,7 +608,7 @@ var entity = new SurfaceLineEntity { Name = "name", - PointsXml = new Point3DXmlSerializer().ToXml(new[] + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new[] { point3D }), @@ -669,7 +669,7 @@ Name = "Better name.", ReferenceLineIntersectionX = random.NextDouble(), ReferenceLineIntersectionY = random.NextDouble(), - PointsXml = new Point3DXmlSerializer().ToXml(points), + PointsXml = new Point3DCollectionXmlSerializer().ToXml(points), MacroStabilityInwardsCharacteristicPointEntities = { CreateMacroStabilityInwardsCharacteristicPointEntity(points[0], (MacroStabilityInwardsCharacteristicPointType) invalidCharacteristicPointType) @@ -694,7 +694,7 @@ var entity = new SurfaceLineEntity { Name = "surface line", - PointsXml = new Point3DXmlSerializer().ToXml(new Point3D[0]) + PointsXml = new Point3DCollectionXmlSerializer().ToXml(new Point3D[0]) }; // Call Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Ringtoets.Storage.Core.Test.csproj =================================================================== diff -u -r4a30aea5c764fc20099bd2b42798590705555633 -r48ccf93f389ff657634f4dd1a1c6c3e414c88b7a --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Ringtoets.Storage.Core.Test.csproj (.../Ringtoets.Storage.Core.Test.csproj) (revision 4a30aea5c764fc20099bd2b42798590705555633) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Ringtoets.Storage.Core.Test.csproj (.../Ringtoets.Storage.Core.Test.csproj) (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -140,7 +140,7 @@ - + Index: Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Serializers/Point3DCollectionXmlSerializerTest.cs =================================================================== diff -u --- Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Serializers/Point3DCollectionXmlSerializerTest.cs (revision 0) +++ Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Serializers/Point3DCollectionXmlSerializerTest.cs (revision 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a) @@ -0,0 +1,66 @@ +// 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 Core.Common.Base.Geometry; +using NUnit.Framework; +using Ringtoets.Storage.Core.Serializers; +using Ringtoets.Storage.Core.TestUtil.Serializers; + +namespace Ringtoets.Storage.Core.Test.Serializers +{ + [TestFixture] + public class Point3DCollectionXmlSerializerTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var serializer = new Point3DCollectionXmlSerializer(); + + // Assert + Assert.IsInstanceOf>(serializer); + SerializerTestHelper.AssertSerializedData(typeof(Point3DCollectionXmlSerializer.SerializablePoint3D)); + } + + [Test] + public void GivenArrayWithPoint3D_WhenConvertingRoundTrip_ThenEqualArrayOfPoints3D() + { + // Given + var original = new[] + { + new Point3D(-6.6, -5.5, -4.4), + new Point3D(-3.3, -2.2, -1.1), + new Point3D(0.0, 1.1, 2.2), + new Point3D(3.3, 4.4, 5.5), + new Point3D(6.6, 7.7, 8.8), + new Point3D(9.9, 10.10, 11.11) + }; + var serializer = new Point3DCollectionXmlSerializer(); + + // When + string xml = serializer.ToXml(original); + Point3D[] roundtripResult = serializer.FromXml(xml); + + // Then + CollectionAssert.AreEqual(original, roundtripResult); + } + } +} \ No newline at end of file Fisheye: Tag 48ccf93f389ff657634f4dd1a1c6c3e414c88b7a refers to a dead (removed) revision in file `Ringtoets/Storage/test/Ringtoets.Storage.Core.Test/Serializers/Point3DXmlSerializerTest.cs'. Fisheye: No comparison available. Pass `N' to diff?