Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj
===================================================================
diff -u -r70e6f175074b3d62532adfda735e6f719602f3b1 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 70e6f175074b3d62532adfda735e6f719602f3b1)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -420,6 +420,10 @@
{50963f12-448c-41ba-a62c-cdb0ab8d21e0}Application.Ringtoets.Storage
+
+ {3EDE00E5-C462-43EF-B8BC-E65D14D7FCF2}
+ Application.Ringtoets.Storage.TestUtil.Test
+ {03DBE353-99F7-47D6-B826-60D694FFB9AC}Application.Ringtoets.Storage.TestUtil
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs
===================================================================
diff -u -r57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision 57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/AssessmentSectionEntityReadExtensionsTest.cs (.../AssessmentSectionEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -25,6 +25,9 @@
using Application.Ringtoets.Storage.DbContext;
using Application.Ringtoets.Storage.Read;
using Application.Ringtoets.Storage.Serializers;
+using Application.Ringtoets.Storage.TestUtil;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
+using Application.Ringtoets.Storage.TestUtil.Test.MacroStabilityInwards;
using Core.Common.Base.Geometry;
using Core.Common.TestUtil;
using NUnit.Framework;
@@ -508,12 +511,20 @@
new StochasticSoilModelEntity
{
Name = "modelA",
- StochasticSoilModelSegmentPointXml = segmentPointsXml
+ StochasticSoilModelSegmentPointXml = segmentPointsXml,
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ }
},
new StochasticSoilModelEntity
{
Name = "modelB",
- StochasticSoilModelSegmentPointXml = segmentPointsXml
+ StochasticSoilModelSegmentPointXml = segmentPointsXml,
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ }
}
},
MacroStabilityInwardsFailureMechanismMetaEntities =
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs
===================================================================
diff -u -r57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision 57bc6a475f6cdd57b1a0ebf70cdf533014afd1ff)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/FailureMechanismEntityReadExtensionsTest.cs (.../FailureMechanismEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -24,6 +24,9 @@
using Application.Ringtoets.Storage.DbContext;
using Application.Ringtoets.Storage.Read;
using Application.Ringtoets.Storage.Serializers;
+using Application.Ringtoets.Storage.TestUtil;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
+using Application.Ringtoets.Storage.TestUtil.Test.MacroStabilityInwards;
using Core.Common.Base;
using Core.Common.Base.Geometry;
using Core.Common.TestUtil;
@@ -723,12 +726,20 @@
new StochasticSoilModelEntity
{
StochasticSoilModelSegmentPointXml = segmentPointsXml,
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ },
Name = "A",
Order = 1
},
new StochasticSoilModelEntity
{
StochasticSoilModelSegmentPointXml = segmentPointsXml,
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ },
Name = "B",
Order = 0
}
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs
===================================================================
diff -u -r69d647795daacbf48e17d0cf3a02a21865ab4ae6 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs) (revision 69d647795daacbf48e17d0cf3a02a21865ab4ae6)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs (.../MacroStabilityInwardsSoilProfileTwoDEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -26,6 +26,7 @@
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;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs
===================================================================
diff -u -r342550ddfacbc6b0253b9b452da4aa68c3fac73f -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs) (revision 342550ddfacbc6b0253b9b452da4aa68c3fac73f)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -24,9 +24,9 @@
using Application.Ringtoets.Storage.Read;
using Application.Ringtoets.Storage.Read.MacroStabilityInwards;
using Application.Ringtoets.Storage.TestUtil;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
-using Ringtoets.MacroStabilityInwards.Primitives;
namespace Application.Ringtoets.Storage.Test.Read.MacroStabilityInwards
{
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs
===================================================================
diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/StochasticSoilModelEntityReadExtensionsTest.cs (.../StochasticSoilModelEntityReadExtensionsTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -25,6 +25,8 @@
using Application.Ringtoets.Storage.Read;
using Application.Ringtoets.Storage.Serializers;
using Application.Ringtoets.Storage.TestUtil;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
+using Application.Ringtoets.Storage.TestUtil.Test.MacroStabilityInwards;
using Core.Common.Base.Geometry;
using NUnit.Framework;
using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
@@ -269,7 +271,11 @@
var entity = new StochasticSoilModelEntity
{
Name = "testName",
- StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(geometry)
+ StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(geometry),
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ }
};
var collector = new ReadConversionCollector();
@@ -279,8 +285,6 @@
// Assert
Assert.IsNotNull(model);
Assert.AreEqual(entity.Name, model.Name);
- CollectionAssert.AreEqual(geometry, model.Geometry);
- CollectionAssert.IsEmpty(model.StochasticSoilProfiles);
}
[Test]
@@ -353,7 +357,11 @@
var entity = new StochasticSoilModelEntity
{
Name = "StochasticSoilModel",
- StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(segmentPoints)
+ StochasticSoilModelSegmentPointXml = new Point2DXmlSerializer().ToXml(segmentPoints),
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ }
};
var collector = new ReadConversionCollector();
@@ -377,7 +385,11 @@
var entity = new StochasticSoilModelEntity
{
Name = "StochasticSoilModel",
- StochasticSoilModelSegmentPointXml = segmentPointsXml
+ StochasticSoilModelSegmentPointXml = segmentPointsXml,
+ MacroStabilityInwardsStochasticSoilProfileEntities =
+ {
+ MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity()
+ }
};
var collector = new ReadConversionCollector();
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj
===================================================================
diff -u -ra1fa1538918813373bcc864f0bce092bf28fd0ce -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision a1fa1538918813373bcc864f0bce092bf28fd0ce)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -58,7 +58,8 @@
Properties\GlobalAssembly.cs
-
+
+
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactoryTest.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactoryTest.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactoryTest.cs (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -0,0 +1,48 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.Serializers;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
+using Core.Common.Base.Geometry;
+using NUnit.Framework;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+
+namespace Application.Ringtoets.Storage.TestUtil.Test
+{
+ [TestFixture]
+ public class MacroStabilityInwardsSoilLayerTwoDEntityTestFactoryTest
+ {
+ [Test]
+ public void CreateMacroStabilityInwardsSoilLayerTwoDEntity_ReturnsMacroStabilityInwardsSoilLayerTwoDEntity()
+ {
+ // Call
+ MacroStabilityInwardsSoilLayerTwoDEntity entity = MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.CreateMacroStabilityInwardsSoilLayerTwoDEntity();
+
+ // Assert
+ Point2D[] outerRing = new Point2DXmlSerializer().FromXml(entity.OuterRingXml);
+ Assert.AreEqual(2, outerRing.Length);
+
+ Ring[] holes = new RingXmlSerializer().FromXml(entity.HolesXml);
+ Assert.AreEqual(0, holes.Length);
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactoryTest.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactoryTest.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactoryTest.cs (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -0,0 +1,49 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards;
+using NUnit.Framework;
+
+namespace Application.Ringtoets.Storage.TestUtil.Test.MacroStabilityInwards
+{
+ [TestFixture]
+ public class MacroStabilityInwardsStochasticSoilProfileEntityTestFactoryTest
+ {
+ [Test]
+ public void CreateStochasticSoilProfileEntity_Always_SetsExpectedParameters()
+ {
+ // Call
+ MacroStabilityInwardsStochasticSoilProfileEntity entity = MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.CreateStochasticSoilProfileEntity();
+
+ // Assert
+ Assert.IsNotNull(entity);
+ Assert.AreEqual(typeof(MacroStabilityInwardsStochasticSoilProfileEntity), entity.GetType());
+
+ Assert.AreEqual(0.34, entity.Probability);
+
+ MacroStabilityInwardsSoilProfileOneDEntity soilProfileEntity = entity.MacroStabilityInwardsSoilProfileOneDEntity;
+ Assert.IsNotNull(soilProfileEntity);
+ Assert.AreEqual("Profile Name", soilProfileEntity.Name);
+ CollectionAssert.IsNotEmpty(soilProfileEntity.MacroStabilityInwardsSoilLayerOneDEntities);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag af575930a392dbf1fb1d5073f3df48110af72686 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/MacroStabilityInwardsSoilLayerTwoDEntityTestFactoryTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj
===================================================================
diff -u -ra1fa1538918813373bcc864f0bce092bf28fd0ce -raf575930a392dbf1fb1d5073f3df48110af72686
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj (.../Application.Ringtoets.Storage.TestUtil.csproj) (revision a1fa1538918813373bcc864f0bce092bf28fd0ce)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/Application.Ringtoets.Storage.TestUtil.csproj (.../Application.Ringtoets.Storage.TestUtil.csproj) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -55,7 +55,8 @@
Properties\GlobalAssembly.cs
-
+
+
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.cs (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -0,0 +1,56 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using Application.Ringtoets.Storage.DbContext;
+using Application.Ringtoets.Storage.Serializers;
+using Core.Common.Base.Geometry;
+using Ringtoets.MacroStabilityInwards.Data.SoilProfile;
+
+namespace Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards
+{
+ ///
+ /// Factory for creating a that can
+ /// be used for testing.
+ ///
+ public static class MacroStabilityInwardsSoilLayerTwoDEntityTestFactory
+ {
+ ///
+ /// Creates a valid .
+ ///
+ /// The created .
+ public static MacroStabilityInwardsSoilLayerTwoDEntity CreateMacroStabilityInwardsSoilLayerTwoDEntity()
+ {
+ var random = new Random(31);
+ var outerRing = new Ring(new[]
+ {
+ new Point2D(random.NextDouble(), random.NextDouble()),
+ new Point2D(random.NextDouble(), random.NextDouble())
+ });
+
+ return new MacroStabilityInwardsSoilLayerTwoDEntity
+ {
+ OuterRingXml = new Point2DXmlSerializer().ToXml(outerRing.Points),
+ HolesXml = new RingXmlSerializer().ToXml(new Ring[0])
+ };
+ }
+ }
+}
\ No newline at end of file
Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.cs
===================================================================
diff -u
--- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.cs (revision 0)
+++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileEntityTestFactory.cs (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -0,0 +1,52 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Application.Ringtoets.Storage.DbContext;
+
+namespace Application.Ringtoets.Storage.TestUtil.MacroStabilityInwards
+{
+ ///
+ /// Factory for creating a that can
+ /// be used for testing.
+ ///
+ public static class MacroStabilityInwardsStochasticSoilProfileEntityTestFactory
+ {
+ ///
+ /// Creates a valid .
+ ///
+ /// A valid .
+ public static MacroStabilityInwardsStochasticSoilProfileEntity CreateStochasticSoilProfileEntity()
+ {
+ return new MacroStabilityInwardsStochasticSoilProfileEntity
+ {
+ Probability = 0.34,
+ MacroStabilityInwardsSoilProfileOneDEntity = new MacroStabilityInwardsSoilProfileOneDEntity
+ {
+ Name = "Profile Name",
+ MacroStabilityInwardsSoilLayerOneDEntities =
+ {
+ new MacroStabilityInwardsSoilLayerOneDEntity()
+ }
+ }
+ };
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag af575930a392dbf1fb1d5073f3df48110af72686 refers to a dead (removed) revision in file `Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/MacroStabilityInwardsSoilLayerTwoDEntityTestFactory.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs
===================================================================
diff -u -rb1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -891,6 +891,16 @@
}
///
+ /// Looks up a localized string similar to Er zijn geen ondergrondschematisaties gevonden in het stochastische ondergrondmodel '{0}'..
+ ///
+ public static string StochasticSoilModel_No_stochasticSoilProfiles_found_for_StochasticSoilModelName_0 {
+ get {
+ return ResourceManager.GetString("StochasticSoilModel_No_stochasticSoilProfiles_found_for_StochasticSoilModelName_0" +
+ "", resourceCulture);
+ }
+ }
+
+ ///
/// Looks up a localized string similar to Stochastische ondergrondmodellen.
///
public static string StochasticSoilModelCollection_TypeDescriptor {
Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx
===================================================================
diff -u -rb1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision b1cb91cbc7d2332a1a82c5d1361c25cd5a4a6ddc)
+++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -405,4 +405,7 @@
Het stochastische ondergrondmodel '{0}' moet een geometrie bevatten.
+
+ Er zijn geen ondergrondschematisaties gevonden in het stochastische ondergrondmodel '{0}'.
+
\ No newline at end of file
Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs
===================================================================
diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358)
+++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.Data/SoilProfile/MacroStabilityInwardsStochasticSoilModel.cs (.../MacroStabilityInwardsStochasticSoilModel.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -44,7 +44,8 @@
/// The geometry of the segment soil model.
/// The stochastic soil profiles of the segment soil model.
/// Thrown when any parameter is null.
- /// Thrown when is empty.
+ /// Thrown when or
+ /// is empty.
public MacroStabilityInwardsStochasticSoilModel(string name,
IEnumerable geometry,
IEnumerable stochasticSoilProfiles)
@@ -66,6 +67,11 @@
string message = string.Format(RingtoetsCommonDataResources.StochasticSoilModel_Geometry_of_StochasticSoilModelName_0_must_contain_a_geometry, name);
throw new ArgumentException(message);
}
+ if (!stochasticSoilProfiles.Any())
+ {
+ string message = string.Format(RingtoetsCommonDataResources.StochasticSoilModel_No_stochasticSoilProfiles_found_for_StochasticSoilModelName_0, name);
+ throw new ArgumentException(message);
+ }
Name = name;
Geometry = geometry;
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs
===================================================================
diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs (.../MacroStabilityInwardsStochasticSoilModelTest.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs (.../MacroStabilityInwardsStochasticSoilModelTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -107,6 +107,27 @@
}
[Test]
+ public void Constructor_StochasticSoilProfilesEmpty_ThrowsArgumentException()
+ {
+ // Setup
+ var random = new Random(21);
+ const string name = "name";
+ var geometry = new[]
+ {
+ new Point2D(random.NextDouble(), random.NextDouble())
+ };
+
+ // Call
+ TestDelegate call = () => new MacroStabilityInwardsStochasticSoilModel(name,
+ geometry,
+ Enumerable.Empty());
+
+ // Assert
+ string expectedMessage = $"Er zijn geen ondergrondschematisaties gevonden in het stochastische ondergrondmodel '{name}'.";
+ TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage);
+ }
+
+ [Test]
[TestCase("")]
[TestCase("segmentSoilModelName")]
public void Constructor_WithValidParameters_ExpectedValues(string segmentSoilModelName)
@@ -283,10 +304,14 @@
var expectedRemovedProfile = new MacroStabilityInwardsStochasticSoilProfile(0.2, soilProfile);
MacroStabilityInwardsStochasticSoilModel model = CreateValidModel(new[]
{
+ CreateStochasticSoilProfile(),
expectedRemovedProfile
});
- MacroStabilityInwardsStochasticSoilModel otherModel = CreateValidModel(Enumerable.Empty());
+ MacroStabilityInwardsStochasticSoilModel otherModel = CreateValidModel(new[]
+ {
+ CreateStochasticSoilProfile()
+ });
// Call
MacroStabilityInwardsStochasticSoilModelProfileDifference difference = model.Update(otherModel);
@@ -544,7 +569,7 @@
private static MacroStabilityInwardsStochasticSoilProfile CreateStochasticSoilProfile()
{
var random = new Random(21);
- return new MacroStabilityInwardsStochasticSoilProfile(0.5, new TestSoilProfile());
+ return new MacroStabilityInwardsStochasticSoilProfile(random.NextDouble(), new TestSoilProfile());
}
private static void AssertStochasticSoilModelAreEqual(MacroStabilityInwardsStochasticSoilModel expected,
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs
===================================================================
diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs (.../MacroStabilityInwardsCalculationConfigurationHelperTest.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/MacroStabilityInwardsCalculationConfigurationHelperTest.cs (.../MacroStabilityInwardsCalculationConfigurationHelperTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -154,38 +154,6 @@
}
[Test]
- public void GetStochasticSoilModelsForSurfaceLine_NoSoilProfiles_ReturnEmpty()
- {
- // Setup
- var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
- {
- new Point2D(1.0, 0.0),
- new Point2D(5.0, 0.0)
- }, Enumerable.Empty());
-
- var availableSoilModels = new[]
- {
- soilModel
- };
-
- var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty);
- surfaceLine.SetGeometry(new[]
- {
- new Point3D(3.0, 5.0, 0.0),
- new Point3D(3.0, 0.0, 1.0),
- new Point3D(3.0, -5.0, 0.0)
- });
-
- // Call
- IEnumerable result = MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(
- surfaceLine,
- availableSoilModels);
-
- // Assert
- CollectionAssert.IsEmpty(result);
- }
-
- [Test]
public void GetStochasticSoilModelsForSurfaceLine_SoilModelGeometryNotIntersecting_ReturnEmpty()
{
// Setup
@@ -439,52 +407,6 @@
}
[Test]
- public void GenerateCalculationItemsStructure_NoSoilProfiles_LogWarning()
- {
- // Setup
- var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
- {
- new Point2D(1.0, 0.0),
- new Point2D(5.0, 0.0)
- }, Enumerable.Empty());
-
- var availableSoilModels = new[]
- {
- soilModel
- };
-
- const string testName = "testName";
- var surfaceLine = new MacroStabilityInwardsSurfaceLine(testName);
- surfaceLine.SetGeometry(new[]
- {
- new Point3D(3.0, 5.0, 0.0),
- new Point3D(3.0, 0.0, 1.0),
- new Point3D(3.0, -5.0, 0.0)
- });
-
- MacroStabilityInwardsSurfaceLine[] surfaceLines =
- {
- surfaceLine
- };
-
- IEnumerable result = null;
- // Call
- Action call = () =>
- {
- result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
- surfaceLines,
- availableSoilModels).ToArray();
- };
-
- // Assert
- Tuple expectedMessage = Tuple.Create(
- $"Geen ondergrondschematisaties gevonden voor profielschematisatie '{testName}'. De profielschematisatie is overgeslagen.",
- LogLevelConstant.Warn);
- TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedMessage);
- CollectionAssert.IsEmpty(result);
- }
-
- [Test]
public void GenerateCalculationItemsStructure_SoilModelGeometryNotIntersecting_LogWarning()
{
// Setup
Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs
===================================================================
diff -u -rb13759ad077f9e2b4104de000b5bdeafa9abe358 -raf575930a392dbf1fb1d5073f3df48110af72686
--- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs (.../MacroStabilityInwardsStochasticSoilModelTransformerTest.cs) (revision b13759ad077f9e2b4104de000b5bdeafa9abe358)
+++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.IO.Test/SoilProfiles/MacroStabilityInwardsStochasticSoilModelTransformerTest.cs (.../MacroStabilityInwardsStochasticSoilModelTransformerTest.cs) (revision af575930a392dbf1fb1d5073f3df48110af72686)
@@ -100,6 +100,28 @@
}
[Test]
+ public void Transform_StochasticSoilModelWithoutStochasticSoilProfiles_ThrowsImportedDataException()
+ {
+ // Setup
+ var stochasticSoilModel = StochasticSoilModelTestFactory.CreateStochasticSoilModelWithGeometry("name",
+ FailureMechanismType.Stability,
+ Enumerable.Empty());
+
+ var transformer = new MacroStabilityInwardsStochasticSoilModelTransformer();
+
+ // Call
+ TestDelegate test = () => transformer.Transform(stochasticSoilModel);
+
+ // Assert
+ var exception = Assert.Throws(test);
+
+ Exception innerException = exception.InnerException;
+ Assert.IsNotNull(innerException);
+ Assert.IsInstanceOf(innerException);
+ Assert.AreEqual(innerException.Message, exception.Message);
+ }
+
+ [Test]
public void Transform_ValidStochasticSoilModelWithSoilProfile1D_ReturnsExpectedMacroStabilityInwardsStochasticSoilModel()
{
// Setup