Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs =================================================================== diff -u -r2d2bea96014455b3ba10a7ba20b8aa1a2d633fca -r342550ddfacbc6b0253b9b452da4aa68c3fac73f --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs) (revision 2d2bea96014455b3ba10a7ba20b8aa1a2d633fca) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs) (revision 342550ddfacbc6b0253b9b452da4aa68c3fac73f) @@ -165,30 +165,36 @@ { // Setup var random = new Random(21); - var entity = new MacroStabilityInwardsStochasticSoilProfileEntity + double probability = random.NextDouble(); + var soilProfileTwoDEntity = new MacroStabilityInwardsSoilProfileTwoDEntity { - Probability = random.NextDouble(), - MacroStabilityInwardsSoilProfileTwoDEntity = new MacroStabilityInwardsSoilProfileTwoDEntity + Name = "SoilProfile", + MacroStabilityInwardsSoilLayerTwoDEntities = { - Name = "SoilProfile", - MacroStabilityInwardsSoilLayerTwoDEntities = - { - MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.CreateMacroStabilityInwardsSoilLayerTwoDEntity() - } + MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.CreateMacroStabilityInwardsSoilLayerTwoDEntity() } }; + + var firstEntity = new MacroStabilityInwardsStochasticSoilProfileEntity + { + Probability = probability, + MacroStabilityInwardsSoilProfileTwoDEntity = soilProfileTwoDEntity + }; + var secondEntity = new MacroStabilityInwardsStochasticSoilProfileEntity + { + Probability = 1 - probability, + MacroStabilityInwardsSoilProfileTwoDEntity = soilProfileTwoDEntity + }; var collector = new ReadConversionCollector(); + MacroStabilityInwardsStochasticSoilProfile firstStochasticSoilProfile = firstEntity.Read(collector); + // Call - MacroStabilityInwardsStochasticSoilProfile stochasticSoilProfile = entity.Read(collector); + MacroStabilityInwardsStochasticSoilProfile secondStochasticSoilProfile = secondEntity.Read(collector); // Assert - Assert.IsNotNull(stochasticSoilProfile); - Assert.AreEqual(entity.Probability, stochasticSoilProfile.Probability, 1e-6); - - IMacroStabilityInwardsSoilProfile profile = stochasticSoilProfile.SoilProfile; - Assert.IsInstanceOf(profile); - Assert.AreEqual(entity.MacroStabilityInwardsSoilProfileTwoDEntity.Name, profile.Name); + Assert.AreNotSame(firstStochasticSoilProfile, secondStochasticSoilProfile); + Assert.AreSame(firstStochasticSoilProfile.SoilProfile, secondStochasticSoilProfile.SoilProfile); } [Test]