Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StochasticSoilModelCreateExtensionsTest.cs =================================================================== diff -u -r4478bdf539df278f9e2aac0f9fe683c34ac55335 -r6a9a423fddb189769e43cc9d69d4dd828a6f68e2 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StochasticSoilModelCreateExtensionsTest.cs (.../StochasticSoilModelCreateExtensionsTest.cs) (revision 4478bdf539df278f9e2aac0f9fe683c34ac55335) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/StochasticSoilModelCreateExtensionsTest.cs (.../StochasticSoilModelCreateExtensionsTest.cs) (revision 6a9a423fddb189769e43cc9d69d4dd828a6f68e2) @@ -21,6 +21,7 @@ using System; using Application.Ringtoets.Storage.Create; +using Application.Ringtoets.Storage.DbContext; using Core.Common.Base.Geometry; @@ -110,5 +111,21 @@ Assert.IsNotNull(entity); Assert.AreEqual(2, entity.StochasticSoilModelSegmentPointEntities.Count); } + + [Test] + public void Create_SameModelCreatedMultipleTimes_ReturnSameEntity() + { + // Setup + var soilModel = new StochasticSoilModel(1, "A", "B"); + + var registry = new PersistenceRegistry(); + + // Call + StochasticSoilModelEntity entity1 = soilModel.Create(registry); + StochasticSoilModelEntity entity2 = soilModel.Create(registry); + + // Assert + Assert.AreSame(entity1, entity2); + } } } \ No newline at end of file