Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs =================================================================== diff -u -raf575930a392dbf1fb1d5073f3df48110af72686 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -25,7 +25,6 @@ using Application.Ringtoets.Storage.Read; using Application.Ringtoets.Storage.Read.MacroStabilityInwards; using Application.Ringtoets.Storage.Serializers; -using Application.Ringtoets.Storage.TestUtil; using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards; using Core.Common.Base.Geometry; using NUnit.Framework; Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs =================================================================== diff -u -r5e5695f9f466a0ab54a59b61879f5d7a66e6ffb1 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision 5e5695f9f466a0ab54a59b61879f5d7a66e6ffb1) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -83,42 +83,16 @@ } [Test] - public void ReadAsPipingStochasticSoilModel_WithMinimumEntity_ReturnsNewStochasticSoilModelWithPropertiesSet() + public void ReadAsPipingStochasticSoilModel_WithValidEntity_ReturnsNewStochasticSoilModelWithPropertiesSet() { // Setup var random = new Random(21); var geometry = new[] { + new Point2D(random.NextDouble(), random.NextDouble()), new Point2D(random.NextDouble(), random.NextDouble()) }; - var entity = new StochasticSoilModelEntity - { - Name = "testName", - StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(geometry), - PipingStochasticSoilProfileEntities = - { - PipingStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity() - } - }; - var collector = new ReadConversionCollector(); - // Call - PipingStochasticSoilModel model = entity.ReadAsPipingStochasticSoilModel(collector); - - // Assert - Assert.IsNotNull(model); - Assert.AreEqual(entity.Name, model.Name); - } - - [Test] - public void ReadAsPipingStochasticSoilModel_WithStochasticSoilProfiles_ReturnsNewPipingStochasticSoilModelWithStochasticSoilProfiles() - { - // Setup - var random = new Random(21); - var geometry = new[] - { - new Point2D(random.NextDouble(), random.NextDouble()) - }; var entity = new StochasticSoilModelEntity { Name = "StochasticSoilModel", @@ -157,6 +131,10 @@ PipingStochasticSoilModel model = entity.ReadAsPipingStochasticSoilModel(collector); // Assert + Assert.IsNotNull(model); + Assert.AreEqual(entity.Name, model.Name); + CollectionAssert.AreEqual(geometry, model.Geometry); + Assert.AreEqual(entity.PipingStochasticSoilProfileEntities.Count, model.StochasticSoilProfiles.Count()); CollectionAssert.AreEqual(new[] { @@ -166,34 +144,6 @@ } [Test] - public void ReadAsPipingStochasticSoilModel_WithStochasticSoilModelSegmentPointXml_ReturnsNewStochasticSoilModelWithGeometryPoints() - { - // Setup - var segmentPoints = new[] - { - new Point2D(1, 2), - new Point2D(3, 4) - }; - - var entity = new StochasticSoilModelEntity - { - Name = "StochasticSoilModel", - StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(segmentPoints), - PipingStochasticSoilProfileEntities = - { - PipingStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity() - } - }; - var collector = new ReadConversionCollector(); - - // Call - PipingStochasticSoilModel model = entity.ReadAsPipingStochasticSoilModel(collector); - - // Assert - CollectionAssert.AreEqual(segmentPoints, model.Geometry); - } - - [Test] public void ReadAsPipingStochasticSoilModel_SameStochasticSoilModelEntityMultipleTimes_ReturnSameStochasticSoilModel() { // Setup @@ -269,49 +219,22 @@ } [Test] - public void ReadAsMacroStabilityInwardsStochasticSoilModel_WithMinimumEntity_ReturnsNewStochasticSoilModelWithPropertiesSet() + public void ReadAsMacroStabilityInwardsStochasticSoilModel_WithValidEntity_ReturnsNewStochasticSoilModelWithPropertiesSet() { // Setup var random = new Random(21); var geometry = new[] { + new Point2D(random.NextDouble(), random.NextDouble()), new Point2D(random.NextDouble(), random.NextDouble()) }; + var entity = new StochasticSoilModelEntity { Name = "testName", StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(geometry), MacroStabilityInwardsStochasticSoilProfileEntities = { - MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity() - } - }; - var collector = new ReadConversionCollector(); - - // Call - MacroStabilityInwardsStochasticSoilModel model = entity.ReadAsMacroStabilityInwardsStochasticSoilModel(collector); - - // Assert - Assert.IsNotNull(model); - Assert.AreEqual(entity.Name, model.Name); - } - - [Test] - public void ReadAsMacroStabilityInwardsStochasticSoilModel_WithStochasticSoilProfiles_ReturnsNewMacroStabilityInwardsStochasticSoilModelWithStochasticSoilProfiles() - { - // Setup - var random = new Random(21); - string segmentPointsXml = new Point2DXmlSerializer().ToXml(new[] - { - new Point2D(random.NextDouble(), random.NextDouble()) - }); - - var entity = new StochasticSoilModelEntity - { - Name = "StochasticSoilModel", - StochasticSoilModelSegmentPointXml = segmentPointsXml, - MacroStabilityInwardsStochasticSoilProfileEntities = - { new MacroStabilityInwardsStochasticSoilProfileEntity { MacroStabilityInwardsSoilProfileOneDEntity = new MacroStabilityInwardsSoilProfileOneDEntity @@ -344,6 +267,10 @@ MacroStabilityInwardsStochasticSoilModel model = entity.ReadAsMacroStabilityInwardsStochasticSoilModel(collector); // Assert + Assert.IsNotNull(model); + Assert.AreEqual(entity.Name, model.Name); + CollectionAssert.AreEqual(geometry, model.Geometry); + Assert.AreEqual(entity.MacroStabilityInwardsStochasticSoilProfileEntities.Count, model.StochasticSoilProfiles.Count()); CollectionAssert.AreEqual(new[] @@ -354,34 +281,6 @@ } [Test] - public void ReadAsMacroStabilityInwardsStochasticSoilModel_WithStochasticSoilModelSegmentPointXml_ReturnsNewStochasticSoilModelWithGeometryPoints() - { - // Setup - var segmentPoints = new[] - { - new Point2D(1, 2), - new Point2D(3, 4) - }; - - var entity = new StochasticSoilModelEntity - { - Name = "StochasticSoilModel", - StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(segmentPoints), - MacroStabilityInwardsStochasticSoilProfileEntities = - { - MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity() - } - }; - var collector = new ReadConversionCollector(); - - // Call - MacroStabilityInwardsStochasticSoilModel model = entity.ReadAsMacroStabilityInwardsStochasticSoilModel(collector); - - // Assert - CollectionAssert.AreEqual(segmentPoints, model.Geometry); - } - - [Test] public void ReadAsMacroStabilityInwardsStochasticSoilModel_SameStochasticSoilModelEntityMultipleTimes_ReturnSameStochasticSoilModel() { // Setup Index: Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/StochasticSoilModelTestFactoryTest.cs =================================================================== diff -u -r30baf70ea42def18e66d1ec3c71aa0e54a89229a -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/StochasticSoilModelTestFactoryTest.cs (.../StochasticSoilModelTestFactoryTest.cs) (revision 30baf70ea42def18e66d1ec3c71aa0e54a89229a) +++ Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/StochasticSoilModelTestFactoryTest.cs (.../StochasticSoilModelTestFactoryTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -36,9 +36,9 @@ public void CreateStochasticSoilModelWithGeometry_WithValidParameters_ReturnsStochasticSoilModelWithGeometry() { // Setup - var random = new Random(21); - const string soilModelName = "some name"; + + var random = new Random(21); var failureMechanismType = random.NextEnumValue(); var mocks = new MockRepository(); Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs =================================================================== diff -u -raf575930a392dbf1fb1d5073f3df48110af72686 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -35,17 +35,17 @@ /// public class MacroStabilityInwardsStochasticSoilModel : Observable, IMechanismStochasticSoilModel { - private readonly List stochasticSoilProfiles = new List(); + private readonly List stochasticSoilProfiles; /// /// Creates a new instance of . /// - /// Name of the segment soil model. + /// The name of the segment soil model. /// The geometry of the segment soil model. /// The stochastic soil profiles of the segment soil model. /// Thrown when any parameter is null. /// Thrown when or - /// is empty. + /// is empty. public MacroStabilityInwardsStochasticSoilModel(string name, IEnumerable geometry, IEnumerable stochasticSoilProfiles) @@ -75,7 +75,7 @@ Name = name; Geometry = geometry; - this.stochasticSoilProfiles.AddRange(stochasticSoilProfiles); + this.stochasticSoilProfiles = new List(stochasticSoilProfiles); } /// Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsStochasticSoilModelTestFactoryTest.cs =================================================================== diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsStochasticSoilModelTestFactoryTest.cs (.../MacroStabilityInwardsStochasticSoilModelTestFactoryTest.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil.Test/MacroStabilityInwardsStochasticSoilModelTestFactoryTest.cs (.../MacroStabilityInwardsStochasticSoilModelTestFactoryTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -31,7 +31,7 @@ public class MacroStabilityInwardsStochasticSoilModelTestFactoryTest { [Test] - public void CreateValidStochasticSoilModel_ParameterLessConstructor_ExpectedPropertiesSet() + public void CreateValidStochasticSoilModel_NoParameters_ReturnsStochasticSoilModelWithExpectedPropertiesSet() { // Call MacroStabilityInwardsStochasticSoilModel model = MacroStabilityInwardsStochasticSoilModelTestFactory.CreateValidStochasticSoilModel(); @@ -56,7 +56,7 @@ } [Test] - public void CreateValidStochasticSoilModel_WithNameParameter_ExpectedPropertiesSet() + public void CreateValidStochasticSoilModel_WithNameParameter_ReturnsStochasticSoilModelWithExpectedPropertiesSet() { // Setup const string soilModelName = "soil model name"; @@ -85,7 +85,7 @@ } [Test] - public void CreateValidStochasticSoilModel_WithNameAndGeometryParameters_ExpectedPropertiesSet() + public void CreateValidStochasticSoilModel_WithNameAndGeometryParameters_ReturnsStochasticSoilModelWithExpectedPropertiesSet() { // Setup const string soilModelName = "soil model name"; @@ -114,7 +114,7 @@ } [Test] - public void CreateValidStochasticSoilModel_WithNameAndSoilProfiles_ExpectedPropertiesSet() + public void CreateValidStochasticSoilModel_WithNameAndSoilProfiles_ReturnsStochasticSoilModelWithExpectedPropertiesSet() { // Setup const string soilModelName = "soil model name"; @@ -142,7 +142,7 @@ } [Test] - public void CreateValidStochasticSoilModel_WithSoilProfiles_ExpectedPropertiesSet() + public void CreateValidStochasticSoilModel_WithSoilProfiles_ReturnsStochasticSoilModelWithExpectedPropertiesSet() { // Setup var stochasticSoilProfiles = new[] Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsStochasticSoilModelTestFactory.cs =================================================================== diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsStochasticSoilModelTestFactory.cs (.../MacroStabilityInwardsStochasticSoilModelTestFactory.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/MacroStabilityInwardsStochasticSoilModelTestFactory.cs (.../MacroStabilityInwardsStochasticSoilModelTestFactory.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -28,7 +28,7 @@ namespace Ringtoets.MacroStabilityInwards.Data.TestUtil { /// - /// Factory which creates valid which + /// Factory that creates valid which /// can be used for testing purposes. /// public static class MacroStabilityInwardsStochasticSoilModelTestFactory @@ -43,8 +43,7 @@ } /// - /// Creates an instance of with - /// a specified name. + /// Creates an instance of . /// /// The name of the soil model. /// A valid configured with the @@ -61,8 +60,7 @@ } /// - /// Creates an instance of - /// with a specified name and geometry. + /// Creates an instance of . /// /// The name of the soil model. /// The geometry of the soil model. @@ -90,8 +88,7 @@ } /// - /// Creates an instance of - /// with a specified name and stochastic soil profiles. + /// Creates an instance of . /// /// The name of the soil model. /// The geometry of the soil model. Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs =================================================================== diff -u -r5e5695f9f466a0ab54a59b61879f5d7a66e6ffb1 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision 5e5695f9f466a0ab54a59b61879f5d7a66e6ffb1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/SoilProfile/PipingStochasticSoilModel.cs (.../PipingStochasticSoilModel.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -37,12 +37,12 @@ /// public class PipingStochasticSoilModel : Observable, IMechanismStochasticSoilModel { - private readonly List stochasticSoilProfiles = new List(); + private readonly List stochasticSoilProfiles; /// /// Creates a new instance of . /// - /// Name of the segment soil model. + /// The name of the segment soil model. /// The geometry of the stochastic soil model. /// The stochastic soil profiles of the model. /// Thrown when any parameter is null. @@ -75,7 +75,7 @@ Name = name; Geometry = geometry; - this.stochasticSoilProfiles.AddRange(stochasticSoilProfiles); + this.stochasticSoilProfiles = new List(stochasticSoilProfiles); } /// Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingStochasticSoilModelTestFactoryTest.cs =================================================================== diff -u -r6b60edb4d7f04f83c74089d70a72c4f79ed413dd -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingStochasticSoilModelTestFactoryTest.cs (.../PipingStochasticSoilModelTestFactoryTest.cs) (revision 6b60edb4d7f04f83c74089d70a72c4f79ed413dd) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil.Test/PipingStochasticSoilModelTestFactoryTest.cs (.../PipingStochasticSoilModelTestFactoryTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -32,7 +32,7 @@ public class PipingStochasticSoilModelTestFactoryTest { [Test] - public void CreatePipingStochasticSoilModel_ExpectedPropertiesSet() + public void CreatePipingStochasticSoilModel_ReturnsPipingStochasticSoilModelWithExpectedPropertiesSet() { // Call PipingStochasticSoilModel model = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel(); @@ -56,7 +56,7 @@ } [Test] - public void CreatePipingStochasticSoilModel_WithName_ExpectedPropertiesSet() + public void CreatePipingStochasticSoilModel_WithName_ReturnsPipingStochasticSoilModelWithExpectedPropertiesSet() { // Setup const string name = "some name"; @@ -82,7 +82,7 @@ } [Test] - public void CreatePipingStochastSoilModel_WithNameAndGeometry_ExpectedPropertiesSet() + public void CreatePipingStochasticSoilModel_WithNameAndGeometry_ReturnsPipingStochasticSoilModelWithExpectedPropertiesSet() { // Setup var random = new Random(21); @@ -109,7 +109,7 @@ } [Test] - public void CreatePipingStochasticSoilModel_WithNameAndStochasticSoilProfiles_ExpectedPropertiesSet() + public void CreatePipingStochasticSoilModel_WithNameAndStochasticSoilProfiles_ReturnsPipingStochasticSoilModelWithExpectedPropertiesSet() { // Setup var random = new Random(21); @@ -135,7 +135,7 @@ } [Test] - public void CreatePipingStochasticSoilModel_WithStochasticSoilProfiles_ExpectedPropertiesSet() + public void CreatePipingStochasticSoilModel_WithStochasticSoilProfiles_ReturnsPipingStochasticSoilModelWithExpectedPropertiesSet() { // Setup var random = new Random(21); Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingStochasticSoilModelTestFactory.cs =================================================================== diff -u -r6b60edb4d7f04f83c74089d70a72c4f79ed413dd -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingStochasticSoilModelTestFactory.cs (.../PipingStochasticSoilModelTestFactory.cs) (revision 6b60edb4d7f04f83c74089d70a72c4f79ed413dd) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/PipingStochasticSoilModelTestFactory.cs (.../PipingStochasticSoilModelTestFactory.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -36,8 +36,7 @@ /// Creates a new instance of . /// /// The name of the stochastic soil model. - /// A valid instance of with - /// the specified . + /// A valid instance of . /// Thrown when /// is null. public static PipingStochasticSoilModel CreatePipingStochasticSoilModel(string name) @@ -63,8 +62,7 @@ /// /// The name of the stochastic soil model. /// The geometry of the stochastic soil model. - /// A valid instance of - /// with the specified and . + /// A valid instance of . /// Thrown when any parameter is null. /// Thrown when is empty. public static PipingStochasticSoilModel CreatePipingStochasticSoilModel(string name, IEnumerable geometry) @@ -81,8 +79,7 @@ /// /// The name of the stochastic soil model. /// The stochastic soil profiles of the soil model. - /// A valid instance of - /// with the specified and . + /// A valid instance of .. /// Thrown when any parameter is null. /// Thrown when is empty. public static PipingStochasticSoilModel CreatePipingStochasticSoilModel(string name, IEnumerable pipingStochasticSoilProfiles) @@ -99,8 +96,7 @@ /// with specified stochastic soil profiles and an empty name. /// /// The geometry of the soil model. - /// A valid configured with the - /// specified . + /// A valid configured . /// Thrown when is null. /// Thrown when is /// empty. Index: Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs =================================================================== diff -u -rd0d3ed3067ec66c52283bd4d1c44011b1a412492 -re0ee945d52cc611d081c9a1412e92023a63f91c9 --- Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs (.../PipingSoilProfileTransformerTest.cs) (revision d0d3ed3067ec66c52283bd4d1c44011b1a412492) +++ Ringtoets/Piping/test/Ringtoets.Piping.IO.Test/SoilProfiles/PipingSoilProfileTransformerTest.cs (.../PipingSoilProfileTransformerTest.cs) (revision e0ee945d52cc611d081c9a1412e92023a63f91c9) @@ -371,7 +371,7 @@ } [Test] - public void Transform_SoilProfileWithoutLayers_ThrowsImportedDataTransformException() + public void Transform_SoilProfile1DWithoutLayers_ThrowsImportedDataTransformException() { // Setup const string profileName = "SomeProfile";