Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensionsTest.cs =================================================================== diff -u -r1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilProfile1DCreateExtensionsTest.cs) (revision 1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsSoilProfile1DCreateExtensionsTest.cs (.../MacroStabilityInwardsSoilProfile1DCreateExtensionsTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -38,7 +38,8 @@ public void Create_PersistenceRegistryNull_ThrowsArgumentNullException() { // Setup - var soilProfile = new TestMacroStabilityInwardsSoilProfile1D(); + MacroStabilityInwardsSoilProfile1D soilProfile = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); // Call TestDelegate test = () => soilProfile.Create(null); @@ -114,7 +115,8 @@ { // Setup const string name = "some name"; - var soilProfile = new TestMacroStabilityInwardsSoilProfile1D(name); + MacroStabilityInwardsSoilProfile1D soilProfile = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(name); var registry = new PersistenceRegistry(); // Call @@ -128,7 +130,8 @@ public void GivenCreatedEntity_WhenCreateCalledOnSameObject_ThenSameEntityReturned() { // Given - var soilProfile = new TestMacroStabilityInwardsSoilProfile1D(); + MacroStabilityInwardsSoilProfile1D soilProfile = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); var registry = new PersistenceRegistry(); MacroStabilityInwardsSoilProfileOneDEntity firstEntity = soilProfile.Create(registry); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensionsTest.cs =================================================================== diff -u -rfe26eb5e452792f9c2ebd62a737a35642210d2f3 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilModelCreateExtensionsTest.cs) (revision fe26eb5e452792f9c2ebd62a737a35642210d2f3) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilModelCreateExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilModelCreateExtensionsTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -94,7 +94,7 @@ { StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.1, new TestMacroStabilityInwardsSoilProfile1D()), + new MacroStabilityInwardsStochasticSoilProfile(0.1, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()), new MacroStabilityInwardsStochasticSoilProfile(0.9, MacroStabilityInwardsSoilProfile2DTestFactory.CreateMacroStabilityInwardsSoilProfile2D()) } }; Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensionsTest.cs =================================================================== diff -u -r1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileCreateExtensionsTest.cs) (revision 1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/MacroStabilityInwards/MacroStabilityInwardsStochasticSoilProfileCreateExtensionsTest.cs (.../MacroStabilityInwardsStochasticSoilProfileCreateExtensionsTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -90,7 +90,8 @@ { // Setup var random = new Random(31); - var soilProfile = new TestMacroStabilityInwardsSoilProfile1D(nameof(MacroStabilityInwardsSoilProfile1D)); + MacroStabilityInwardsSoilProfile1D soilProfile = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(nameof(MacroStabilityInwardsSoilProfile1D)); var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(random.NextDouble(), soilProfile); int order = random.Next(); @@ -113,7 +114,8 @@ { // Setup var random = new Random(31); - MacroStabilityInwardsSoilProfile2D soilProfile = MacroStabilityInwardsSoilProfile2DTestFactory.CreateMacroStabilityInwardsSoilProfile2D(); + MacroStabilityInwardsSoilProfile2D soilProfile = + MacroStabilityInwardsSoilProfile2DTestFactory.CreateMacroStabilityInwardsSoilProfile2D(); var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(random.NextDouble(), soilProfile); int order = random.Next(); @@ -137,7 +139,7 @@ // Setup var random = new Random(31); - var soilProfile = new TestMacroStabilityInwardsSoilProfile1D(nameof(MacroStabilityInwardsSoilProfile1D)); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); var firstStochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(random.NextDouble(), soilProfile); var secondStochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(random.NextDouble(), soilProfile); var registry = new PersistenceRegistry(); @@ -199,7 +201,7 @@ private static IEnumerable GetMacroStabilityInwardsSoilProfiles() { - yield return new TestMacroStabilityInwardsSoilProfile1D(nameof(MacroStabilityInwardsSoilProfile1D)); + yield return MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(nameof(MacroStabilityInwardsSoilProfile1D)); yield return MacroStabilityInwardsSoilProfile2DTestFactory.CreateMacroStabilityInwardsSoilProfile2D(); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs =================================================================== diff -u -r2d2bea96014455b3ba10a7ba20b8aa1a2d633fca -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision 2d2bea96014455b3ba10a7ba20b8aa1a2d633fca) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -190,7 +190,7 @@ protected override MacroStabilityInwardsSoilProfile1D CreateDataModel() { - return new TestMacroStabilityInwardsSoilProfile1D(); + return MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs =================================================================== diff -u -r07552978e68ab62d36f7086f9f5c84411a2fee9f -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 07552978e68ab62d36f7086f9f5c84411a2fee9f) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -377,7 +377,7 @@ protected override MacroStabilityInwardsStochasticSoilProfile CreateDataModel() { - return new MacroStabilityInwardsStochasticSoilProfile(1, new TestMacroStabilityInwardsSoilProfile1D()); + return new MacroStabilityInwardsStochasticSoilProfile(1, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()); } } Index: Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs =================================================================== diff -u -r3fe99efe7580ec1d9eb850908c001c990dc43fe5 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3fe99efe7580ec1d9eb850908c001c990dc43fe5) +++ Ringtoets/MacroStabilityInwards/src/Ringtoets.MacroStabilityInwards.IO/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -1,4 +1,25 @@ -//------------------------------------------------------------------------------ +// 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. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsInputTest.cs =================================================================== diff -u -r89a636adaa25d5bb86bc8f4618126e5364664ab1 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsInputTest.cs (.../MacroStabilityInwardsInputTest.cs) (revision 89a636adaa25d5bb86bc8f4618126e5364664ab1) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/MacroStabilityInwardsInputTest.cs (.../MacroStabilityInwardsInputTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -370,7 +370,8 @@ var inputParameters = new MacroStabilityInwardsInput(); // When - inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0, soilProfile); // Then Assert.IsNull(inputParameters.SoilProfileUnderSurfaceLine); @@ -390,7 +391,8 @@ new Point3D(1, 1, 1) }); inputParameters.SurfaceLine = surfaceLine; - inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0, soilProfile); // Then Assert.IsNotNull(inputParameters.SoilProfileUnderSurfaceLine); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs =================================================================== diff -u -r0b5e18b2ddd0f4af4e6483464a48c92d70531aa9 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs (.../MacroStabilityInwardsStochasticSoilModelTest.cs) (revision 0b5e18b2ddd0f4af4e6483464a48c92d70531aa9) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.Test/SoilProfile/MacroStabilityInwardsStochasticSoilModelTest.cs (.../MacroStabilityInwardsStochasticSoilModelTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -299,14 +299,18 @@ public void Update_ModelsWithAddedProfilesWithSameNames_ThrowsInvalidOperationException() { // Setup - var addedProfile = new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfileOne = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var addedStochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.2, soilProfileOne); MacroStabilityInwardsStochasticSoilModel otherModel = CreateEmptyModel(); - otherModel.StochasticSoilProfiles.Add(addedProfile); + otherModel.StochasticSoilProfiles.Add(addedStochasticSoilProfile); - var existingProfile = new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfileTwo = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var existingStochastSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.2, soilProfileTwo); MacroStabilityInwardsStochasticSoilModel model = CreateEmptyModel(); - model.StochasticSoilProfiles.Add(existingProfile); - model.StochasticSoilProfiles.Add(existingProfile); + model.StochasticSoilProfiles.Add(existingStochastSoilProfile); + model.StochasticSoilProfiles.Add(existingStochastSoilProfile); // Call TestDelegate call = () => model.Update(otherModel); @@ -315,13 +319,13 @@ Assert.Throws(call); Assert.AreEqual(1, otherModel.StochasticSoilProfiles.Count); - Assert.AreEqual(addedProfile, otherModel.StochasticSoilProfiles[0]); + Assert.AreEqual(addedStochasticSoilProfile, otherModel.StochasticSoilProfiles[0]); Assert.AreEqual(2, model.StochasticSoilProfiles.Count); CollectionAssert.AreEqual(new[] { - existingProfile, - existingProfile + existingStochastSoilProfile, + existingStochastSoilProfile }, model.StochasticSoilProfiles); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestStochasticSoilModel.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestStochasticSoilModel.cs (.../TestStochasticSoilModel.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Data.TestUtil/TestStochasticSoilModel.cs (.../TestStochasticSoilModel.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -20,6 +20,7 @@ // All rights reserved. using Ringtoets.MacroStabilityInwards.Data.SoilProfile; +using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; namespace Ringtoets.MacroStabilityInwards.Data.TestUtil @@ -35,10 +36,15 @@ /// The name of the stochastic soil model. public TestStochasticSoilModel(string name) : base(name) { + MacroStabilityInwardsSoilProfile1D soilProfileA = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D("A"); + MacroStabilityInwardsSoilProfile1D soilProfileB = + MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D("B"); + StochasticSoilProfiles.AddRange(new[] { - new MacroStabilityInwardsStochasticSoilProfile(0.5, new TestMacroStabilityInwardsSoilProfile1D("A")), - new MacroStabilityInwardsStochasticSoilProfile(0.5, new TestMacroStabilityInwardsSoilProfile1D("B")) + new MacroStabilityInwardsStochasticSoilProfile(0.5, soilProfileA), + new MacroStabilityInwardsStochasticSoilProfile(0.5, soilProfileB) }); } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs =================================================================== diff -u -r4e00271fd762917c0ce059fe0697e607ed0065fb -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision 4e00271fd762917c0ce059fe0697e607ed0065fb) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsInputContextPropertiesTest.cs (.../MacroStabilityInwardsInputContextPropertiesTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -830,7 +830,8 @@ var properties = new MacroStabilityInwardsInputContextProperties(context, handler); - inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + inputParameters.StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile); // Call properties.SurfaceLine = newSurfaceLine; @@ -851,7 +852,8 @@ mocks.ReplayAll(); MacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); - var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile); var stochasticSoilModel = new MacroStabilityInwardsStochasticSoilModel("StochasticSoilModelName"); stochasticSoilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); @@ -896,16 +898,17 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - var soilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile); var stochasticSoilModel = new MacroStabilityInwardsStochasticSoilModel("StochasticSoilModelName"); - stochasticSoilModel.StochasticSoilProfiles.Add(soilProfile); + stochasticSoilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); var calculationItem = new MacroStabilityInwardsCalculationScenario { InputParameters = { SurfaceLine = ValidSurfaceLine(0, 4), StochasticSoilModel = stochasticSoilModel, - StochasticSoilProfile = soilProfile + StochasticSoilProfile = stochasticSoilProfile } }; @@ -948,11 +951,13 @@ mocks.ReplayAll(); MacroStabilityInwardsSurfaceLine testSurfaceLine = ValidSurfaceLine(0, 2); - var stochasticSoilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile1 = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile1); var stochasticSoilModel1 = new MacroStabilityInwardsStochasticSoilModel("StochasticSoilModel1Name"); stochasticSoilModel1.StochasticSoilProfiles.Add(stochasticSoilProfile1); - var stochasticSoilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile2 = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile2); var stochasticSoilModel2 = new MacroStabilityInwardsStochasticSoilModel("StochasticSoilModel2Name"); stochasticSoilModel1.StochasticSoilProfiles.Add(stochasticSoilProfile2); @@ -1069,7 +1074,8 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile( + 0.2, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("C") @@ -1081,7 +1087,8 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile( + 0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("E") @@ -1093,7 +1100,8 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile( + 0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } } }; @@ -1166,7 +1174,8 @@ { StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile( + 1.0, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }; var calculation = new MacroStabilityInwardsCalculationScenario @@ -1599,7 +1608,8 @@ private static MacroStabilityInwardsStochasticSoilModel ValidStochasticSoilModel(double xMin, double xMax) { var stochasticSoilModel = new MacroStabilityInwardsStochasticSoilModel("StochasticSoilModelName"); - stochasticSoilModel.StochasticSoilProfiles.Add(new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D())); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + stochasticSoilModel.StochasticSoilProfiles.Add(new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile)); stochasticSoilModel.Geometry.Add(new Point2D(xMin, 1.0)); stochasticSoilModel.Geometry.Add(new Point2D(xMax, 0.0)); return stochasticSoilModel; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsStochasticSoilProfilePropertiesTest.cs =================================================================== diff -u -rade9597f8f050ca97431db031d9dc7dc87f715ba -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsStochasticSoilProfilePropertiesTest.cs (.../MacroStabilityInwardsStochasticSoilProfilePropertiesTest.cs) (revision ade9597f8f050ca97431db031d9dc7dc87f715ba) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/PropertyClasses/MacroStabilityInwardsStochasticSoilProfilePropertiesTest.cs (.../MacroStabilityInwardsStochasticSoilProfilePropertiesTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -56,7 +56,8 @@ public void Constructor_ValidStochasticSoilProfile_ExpectedValues() { // Setup - var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, soilProfile); // Call var properties = new MacroStabilityInwardsStochasticSoilProfileProperties(stochasticSoilProfile); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilModelSelectionEditorTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -103,7 +103,8 @@ var assessmentSection = mockRepository.Stub(); var handler = mockRepository.Stub(); - var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, soilProfile); var stochasticSoilModel = new MacroStabilityInwardsStochasticSoilModel("Model") { Geometry = Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/UITypeEditors/MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs (.../MacroStabilityInwardsInputContextStochasticSoilProfileSelectionEditorTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -57,9 +57,10 @@ var calculationItem = new MacroStabilityInwardsCalculationScenario(); var failureMechanism = new MacroStabilityInwardsFailureMechanism(); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); var input = new MacroStabilityInwardsInput { - StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()) + StochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, soilProfile) }; var inputContext = new MacroStabilityInwardsInputContext(input, calculationItem, @@ -103,7 +104,8 @@ var assessmentSection = mockRepository.Stub(); var handler = mockRepository.Stub(); - var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var stochasticSoilProfile = new MacroStabilityInwardsStochasticSoilProfile(1.0, soilProfile); var stochasticSoilModel = new MacroStabilityInwardsStochasticSoilModel("Model") { Geometry = Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationRowTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationRowTest.cs (.../MacroStabilityInwardsCalculationRowTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Forms.Test/Views/MacroStabilityInwardsCalculationRowTest.cs (.../MacroStabilityInwardsCalculationRowTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -35,6 +35,7 @@ using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.Data.TestUtil; using Ringtoets.MacroStabilityInwards.Forms.Views; +using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; namespace Ringtoets.MacroStabilityInwards.Forms.Test.Views @@ -178,7 +179,8 @@ public void StochasticSoilProfile_AlwaysOnChange_NotifyObserverAndCalculationPropertyChanged() { // Setup - var newProfile = new MacroStabilityInwardsStochasticSoilProfile(0, new TestMacroStabilityInwardsSoilProfile1D()); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + var newProfile = new MacroStabilityInwardsStochasticSoilProfile(0, soilProfile); var newValue = new DataGridViewComboBoxItemWrapper(newProfile); var calculation = new MacroStabilityInwardsCalculationScenario(); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs =================================================================== diff -u -r55ae69f1f31e0109eb98f4008629b28bbb825a8e -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs (.../MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs) (revision 55ae69f1f31e0109eb98f4008629b28bbb825a8e) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs (.../MacroStabilityInwardsStochasticSoilModelUpdateDataStrategyTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -569,8 +569,8 @@ var model = new MacroStabilityInwardsStochasticSoilModel(modelName); foreach (string profileName in profileNames) { - model.StochasticSoilProfiles.Add( - new MacroStabilityInwardsStochasticSoilProfile(1.0 / profileNames.Length, new TestMacroStabilityInwardsSoilProfile1D(profileName))); + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(profileName); + model.StochasticSoilProfiles.Add(new MacroStabilityInwardsStochasticSoilProfile(1.0 / profileNames.Length, soilProfile)); } return model; } Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/FileImporter/MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs (.../MacroStabilityInwardsSurfaceLineUpdateDataStrategyTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -572,7 +572,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.2, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("C") @@ -584,7 +584,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } } }; @@ -640,7 +640,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.2, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("C") @@ -652,7 +652,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("E") @@ -664,7 +664,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } } }; @@ -728,7 +728,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.2, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }; @@ -870,7 +870,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.2, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.2, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } }, new MacroStabilityInwardsStochasticSoilModel("C") @@ -882,7 +882,7 @@ }, StochasticSoilProfiles = { - new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) } } }; Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsStochasticSoilProfilePropertyInfoTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsStochasticSoilProfilePropertyInfoTest.cs (.../MacroStabilityInwardsStochasticSoilProfilePropertyInfoTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Plugin.Test/PropertyInfos/MacroStabilityInwardsStochasticSoilProfilePropertyInfoTest.cs (.../MacroStabilityInwardsStochasticSoilProfilePropertyInfoTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -23,8 +23,10 @@ using Core.Common.Gui.Plugin; using Core.Common.Gui.PropertyBag; using NUnit.Framework; +using Rhino.Mocks; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; using Ringtoets.MacroStabilityInwards.Forms.PropertyClasses; +using Ringtoets.MacroStabilityInwards.Primitives; using Ringtoets.MacroStabilityInwards.Primitives.TestUtil; namespace Ringtoets.MacroStabilityInwards.Plugin.Test.PropertyInfos @@ -57,17 +59,23 @@ } [Test] - public void CreateInstance_Always_NewPropertiesWithInputContextAsData() + public void CreateInstance_WithStochasticSoilprofile_NewPropertiesWithInputContextAsData() { // Setup - var context = new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()); + var mocks = new MockRepository(); + var soilProfile = mocks.Stub(); + mocks.ReplayAll(); + var context = new MacroStabilityInwardsStochasticSoilProfile(0.0, soilProfile); + // Call IObjectProperties objectProperties = info.CreateInstance(context); // Assert Assert.IsInstanceOf(objectProperties); Assert.AreSame(context, objectProperties.Data); + + mocks.VerifyAll(); } } } \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/MacroStabilityInwardsSoilProfile1DTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/MacroStabilityInwardsSoilProfile1DTestFactoryTest.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/MacroStabilityInwardsSoilProfile1DTestFactoryTest.cs (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -0,0 +1,67 @@ +// 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.Linq; +using NUnit.Framework; + +namespace Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test +{ + [TestFixture] + public class MacroStabilityInwardsSoilProfile1DTestFactoryTest + { + [Test] + public void CreateMacroStabilityInwardsSoilProfile1D_WithValidName_ReturnsSoilProfileWithExpectedValues() + { + // Setup + const string name = "soilProfile"; + + // Call + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(name); + + // Assert + Assert.IsNotNull(soilProfile); + + Assert.AreEqual(typeof(MacroStabilityInwardsSoilProfile1D), soilProfile.GetType()); + Assert.AreEqual(name, soilProfile.Name); + Assert.AreEqual(0.0, soilProfile.Bottom); + + MacroStabilityInwardsSoilLayer1D soiLayer = soilProfile.Layers.Single(); + Assert.AreEqual(0.0, soiLayer.Top); + } + + [Test] + public void CreateMacroStabilityInwardsSoilProfile1D_WithoutArguments_ReturnsSoilProfileWithExpectedValues() + { + // Call + MacroStabilityInwardsSoilProfile1D soilProfile = MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D(); + + // Assert + Assert.IsNotNull(soilProfile); + + Assert.AreEqual(typeof(MacroStabilityInwardsSoilProfile1D), soilProfile.GetType()); + Assert.IsEmpty(soilProfile.Name); + Assert.AreEqual(0.0, soilProfile.Bottom); + + MacroStabilityInwardsSoilLayer1D soiLayer = soilProfile.Layers.Single(); + Assert.AreEqual(0.0, soiLayer.Top); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test.csproj =================================================================== diff -u -r1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test.csproj) (revision 1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test.csproj) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -54,7 +54,7 @@ - + Fisheye: Tag 0ca80ea0128c50442c9ab707f715125d65cf7fa0 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.Test/TestMacroStabilityInwardsSoilProfile1DTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/MacroStabilityInwardsSoilProfile1DTestFactory.cs =================================================================== diff -u --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/MacroStabilityInwardsSoilProfile1DTestFactory.cs (revision 0) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/MacroStabilityInwardsSoilProfile1DTestFactory.cs (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -0,0 +1,67 @@ +// 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. + +namespace Ringtoets.MacroStabilityInwards.Primitives.TestUtil +{ + /// + /// A factor to create configured that + /// can be used for testing. + /// + public static class MacroStabilityInwardsSoilProfile1DTestFactory + { + /// + /// Creates a new instance of which has: + /// + /// set to an empty name. + /// set to 0.0. + /// set to a collection with a single . + /// with set to 0.0. + /// + /// + /// + public static MacroStabilityInwardsSoilProfile1D CreateMacroStabilityInwardsSoilProfile1D() + { + return new MacroStabilityInwardsSoilProfile1D(string.Empty, 0.0, new[] + { + new MacroStabilityInwardsSoilLayer1D(0.0) + }); + } + + /// + /// Creates a new instance of which has: + /// + /// set to . + /// set to 0.0. + /// set to a collection with a single . + /// with set to 0.0. + /// + /// + /// The name for the profile. + /// + public static MacroStabilityInwardsSoilProfile1D CreateMacroStabilityInwardsSoilProfile1D(string name) + { + return new MacroStabilityInwardsSoilProfile1D(name, 0.0, new[] + { + new MacroStabilityInwardsSoilLayer1D(0.0) + }); + } + } +} \ No newline at end of file Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.csproj =================================================================== diff -u -r1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.TestUtil.csproj) (revision 1ba21a629ef9ee35b003e5f5e66f26f5b8bc7766) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/Ringtoets.MacroStabilityInwards.Primitives.TestUtil.csproj (.../Ringtoets.MacroStabilityInwards.Primitives.TestUtil.csproj) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -50,7 +50,7 @@ - + Fisheye: Tag 0ca80ea0128c50442c9ab707f715125d65cf7fa0 refers to a dead (removed) revision in file `Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Primitives.TestUtil/TestMacroStabilityInwardsSoilProfile1D.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs (.../MacroStabilityInwardsDataSynchronizationServiceTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsDataSynchronizationServiceTest.cs (.../MacroStabilityInwardsDataSynchronizationServiceTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -493,7 +493,7 @@ // Call TestDelegate test = () => MacroStabilityInwardsDataSynchronizationService.RemoveStochasticSoilProfileFromInput( null, - new MacroStabilityInwardsStochasticSoilProfile(0.5, new TestMacroStabilityInwardsSoilProfile1D())); + new MacroStabilityInwardsStochasticSoilProfile(0.5, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D())); // Assert var exception = Assert.Throws(test); @@ -624,7 +624,7 @@ // Call TestDelegate test = () => MacroStabilityInwardsDataSynchronizationService.ClearStochasticSoilProfileDependentData( null, - new MacroStabilityInwardsStochasticSoilProfile(0.5, new TestMacroStabilityInwardsSoilProfile1D())); + new MacroStabilityInwardsStochasticSoilProfile(0.5, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D())); // Assert var exception = Assert.Throws(test); Index: Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputServiceTest.cs =================================================================== diff -u -rf2ba7f68f5de2fc3c8dec8baf7326808120cee52 -r0ca80ea0128c50442c9ab707f715125d65cf7fa0 --- Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputServiceTest.cs (.../MacroStabilityInwardsInputServiceTest.cs) (revision f2ba7f68f5de2fc3c8dec8baf7326808120cee52) +++ Ringtoets/MacroStabilityInwards/test/Ringtoets.MacroStabilityInwards.Service.Test/MacroStabilityInwardsInputServiceTest.cs (.../MacroStabilityInwardsInputServiceTest.cs) (revision 0ca80ea0128c50442c9ab707f715125d65cf7fa0) @@ -93,7 +93,7 @@ public void SyncStochasticSoilProfileWithStochasticSoilModel_SingleStochasticSoilProfileInStochasticSoilModel_SetsStochasticSoilProfile() { // Setup - var soilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()); + var soilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()); var soilModel = new MacroStabilityInwardsStochasticSoilModel("A"); soilModel.StochasticSoilProfiles.Add(soilProfile); @@ -117,8 +117,8 @@ var soilModel = new MacroStabilityInwardsStochasticSoilModel("A"); soilModel.StochasticSoilProfiles.AddRange(new[] { - new MacroStabilityInwardsStochasticSoilProfile(0.0, new TestMacroStabilityInwardsSoilProfile1D()), - new MacroStabilityInwardsStochasticSoilProfile(1.0, new TestMacroStabilityInwardsSoilProfile1D()) + new MacroStabilityInwardsStochasticSoilProfile(0.0, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()), + new MacroStabilityInwardsStochasticSoilProfile(1.0, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()) }); var input = new MacroStabilityInwardsInput { @@ -136,7 +136,7 @@ public void SyncStochasticSoilProfileWithStochasticSoilModel_SingleStochasticSoilProfileInSoilModelAlreadySet_StochasticSoilProfileDoesNotChange() { // Setup - var soilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.3, new TestMacroStabilityInwardsSoilProfile1D()); + var soilProfile = new MacroStabilityInwardsStochasticSoilProfile(0.3, MacroStabilityInwardsSoilProfile1DTestFactory.CreateMacroStabilityInwardsSoilProfile1D()); var soilModel = new MacroStabilityInwardsStochasticSoilModel("A"); soilModel.StochasticSoilProfiles.Add(soilProfile);