Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs =================================================================== diff -u -r9e1b97e9540df6cbd635120135c83de0260aa6d1 -r36ed0869d04cd54d2aee0abbd0ec88100334e097 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs (.../RingtoetsPipingSurfaceLineCreateExtensionsTest.cs) (revision 9e1b97e9540df6cbd635120135c83de0260aa6d1) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/RingtoetsPipingSurfaceLineCreateExtensionsTest.cs (.../RingtoetsPipingSurfaceLineCreateExtensionsTest.cs) (revision 36ed0869d04cd54d2aee0abbd0ec88100334e097) @@ -56,14 +56,17 @@ var collector = new CreateConversionCollector(); var surfaceLine = new RingtoetsPipingSurfaceLine { - Name = "Test" + Name = "Test", + ReferenceLineIntersectionWorldPoint = new Point2D(1235.439, 49308.346) }; // Call SurfaceLineEntity entity = surfaceLine.Create(collector); // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(0, entity.SurfaceLineEntityId); Assert.AreEqual(0, entity.FailureMechanismEntityId); @@ -84,7 +87,8 @@ }; var surfaceLine = new RingtoetsPipingSurfaceLine { - Name = "Test" + Name = "Test", + ReferenceLineIntersectionWorldPoint = new Point2D(1.1, 2.2) }; surfaceLine.SetGeometry(geometry); @@ -93,6 +97,8 @@ // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(geometry.Length, entity.SurfaceLinePointEntities.Count); SurfaceLinePointEntity[] pointEntities = entity.SurfaceLinePointEntities.ToArray(); @@ -130,7 +136,8 @@ }; var surfaceLine = new RingtoetsPipingSurfaceLine { - Name = "Test" + Name = "Test", + ReferenceLineIntersectionWorldPoint = new Point2D(3.3, 4.4) }; surfaceLine.SetGeometry(geometry); const int bottomDitchDikeIndex = 1; @@ -151,6 +158,8 @@ // Assert Assert.AreEqual(surfaceLine.Name, entity.Name); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.X, entity.ReferenceLineIntersectionX); + Assert.AreEqual(surfaceLine.ReferenceLineIntersectionWorldPoint.Y, entity.ReferenceLineIntersectionY); Assert.AreEqual(geometry.Length, entity.SurfaceLinePointEntities.Count); SurfaceLinePointEntity[] pointEntities = entity.SurfaceLinePointEntities.ToArray(); @@ -193,5 +202,25 @@ Assert.AreEqual(0, entity.FailureMechanismEntityId); Assert.IsNull(entity.FailureMechanismEntity); } + + [Test] + public void Create_SurfaceLine_RegisterNewEntityToCreateConversionCollector() + { + // Setup + var collector = new CreateConversionCollector(); + var surfaceLine = new RingtoetsPipingSurfaceLine + { + ReferenceLineIntersectionWorldPoint = new Point2D(0.0, 0.0) + }; + + // Call + SurfaceLineEntity entity = surfaceLine.Create(collector); + + // Assert + const long entityId = 125673543; + entity.SurfaceLineEntityId = entityId; + collector.TransferIds(); + Assert.AreEqual(entityId, surfaceLine.StorageId); + } } } \ No newline at end of file