Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs =================================================================== diff -u -r17651988db014bcbf2059c03ba0aef438f79bec4 -r220a073b3d2066d57af048325e3ba37bb1340d0d --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision 17651988db014bcbf2059c03ba0aef438f79bec4) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingFailureMechanismTest.cs (.../PipingFailureMechanismTest.cs) (revision 220a073b3d2066d57af048325e3ba37bb1340d0d) @@ -3,6 +3,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data; +using Ringtoets.Piping.KernelWrapper.TestUtil; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Data.Test @@ -193,5 +194,41 @@ // Assert CollectionAssert.DoesNotContain(failureMechanism.CalculationsGroup.Children, folder); } + + [Test] + public void SoilProfiles_StochasticSoilModelsWithDuplicateProfiles_ReturnsDistinctProfiles() + { + // Setup + var failureMechanism = new PipingFailureMechanism(); + PipingSoilProfile profile = new TestPipingSoilProfile(); + StochasticSoilProfile stochasticProfile = new StochasticSoilProfile(0, SoilProfileType.SoilProfile1D, 0) + { + SoilProfile = profile + }; + failureMechanism.StochasticSoilModels.AddRange(new[] + { + new StochasticSoilModel(0, string.Empty, string.Empty) + { + StochasticSoilProfiles = + { + stochasticProfile + } + }, + new StochasticSoilModel(0, string.Empty, string.Empty) + { + StochasticSoilProfiles = + { + stochasticProfile + } + } + }); + + // Call + var profiles = failureMechanism.SoilProfiles; + + // Assert + Assert.AreEqual(1, profiles.Count); + Assert.AreSame(profile, profiles.First()); + } } } \ No newline at end of file