Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs =================================================================== diff -u -r8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs (.../DikeProfileCreateExtensionsTest.cs) (revision 8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/DikeProfileCreateExtensionsTest.cs (.../DikeProfileCreateExtensionsTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -38,7 +38,7 @@ public void Create_RegistryIsNull_ThrowArgumentNullException() { // Setup - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); // Call TestDelegate call = () => dikeProfile.Create(null, 0); @@ -180,7 +180,7 @@ public void Create_DikeProfileAlreadyRegistered_ReturnRegisteredEntity() { // Setup - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var registry = new PersistenceRegistry(); DikeProfileEntity entity1 = dikeProfile.Create(registry, 0); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs =================================================================== diff -u -ra096cb901099c85dbaafa2dba6c69288464c248e -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs) (revision a096cb901099c85dbaafa2dba6c69288464c248e) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationCreateExtensionsTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -198,7 +198,7 @@ public void Create_CalculationWithAlreadySavedDikeProfile_ReturnEntityWithDikeProfileEntity() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var calculation = new GrassCoverErosionInwardsCalculation { InputParameters = Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensionsTest.cs =================================================================== diff -u -rfe90a6d174a01975381e6cda55ed1f7f4e831a51 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionInwardsFailureMechanismCreateExtensionsTest.cs) (revision fe90a6d174a01975381e6cda55ed1f7f4e831a51) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/GrassCoverErosionInwards/GrassCoverErosionInwardsFailureMechanismCreateExtensionsTest.cs (.../GrassCoverErosionInwardsFailureMechanismCreateExtensionsTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -183,8 +183,8 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile(string.Empty, "id1"), - new TestDikeProfile(string.Empty, "id2") + DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id1"), + DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id2") }, sourcePath); var registry = new PersistenceRegistry(); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs =================================================================== diff -u -r7078f0ab14bab4985d611c668d73267e3a37c8d0 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision 7078f0ab14bab4985d611c668d73267e3a37c8d0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/PersistenceRegistryTest.cs (.../PersistenceRegistryTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -299,7 +299,7 @@ protected override DikeProfile CreateDataModel() { - return new TestDikeProfile(); + return DikeProfileTestFactory.CreateDikeProfile(); } } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensionsTest.cs =================================================================== diff -u -r8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensionsTest.cs (.../DikeProfileEntityReadExtensionsTest.cs) (revision 8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/DikeProfileEntityReadExtensionsTest.cs (.../DikeProfileEntityReadExtensionsTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -220,7 +220,7 @@ { // Setup var registeredEntity = new DikeProfileEntity(); - DikeProfile registeredProfile = new TestDikeProfile(); + DikeProfile registeredProfile = DikeProfileTestFactory.CreateDikeProfile(); var collector = new ReadConversionCollector(); collector.Read(registeredEntity, registeredProfile); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -r8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs) (revision 8ff26e0d7885f432a6e470e8d68ce325bdc6a9bc) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/GrassCoverErosionInwards/GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs (.../GrassCoverErosionInwardsCalculationEntityReadExtensionsTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -171,7 +171,7 @@ public void Read_ValidEntityWithAlreadyReadDikeProfileEntity_ReturnCalculationWithReadDikeProfile() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var dikeProfileEntity = new DikeProfileEntity(); var entity = new GrassCoverErosionInwardsCalculationEntity { Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs =================================================================== diff -u -r7078f0ab14bab4985d611c668d73267e3a37c8d0 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 7078f0ab14bab4985d611c668d73267e3a37c8d0) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/ReadConversionCollectorTest.cs (.../ReadConversionCollectorTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -317,7 +317,7 @@ protected override DikeProfile CreateDataModel() { - return new TestDikeProfile(); + return DikeProfileTestFactory.CreateDikeProfile(); } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/DikeProfile.cs =================================================================== diff -u -r677ec9937ae7eff73a09bf937804ad22e0dc5a4b -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/DikeProfile.cs (.../DikeProfile.cs) (revision 677ec9937ae7eff73a09bf937804ad22e0dc5a4b) +++ Ringtoets/Common/src/Ringtoets.Common.Data/DikeProfiles/DikeProfile.cs (.../DikeProfile.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -218,8 +218,11 @@ { return true; } - var other = obj as DikeProfile; - return other != null && Equals(other); + if (GetType() != obj.GetType()) + { + return false; + } + return Equals((DikeProfile) obj); } public override int GetHashCode() Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileCollectionTest.cs =================================================================== diff -u -r7aa336d8c0d38c5af631d480da9c8c62a7f4e261 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileCollectionTest.cs (.../DikeProfileCollectionTest.cs) (revision 7aa336d8c0d38c5af631d480da9c8c62a7f4e261) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileCollectionTest.cs (.../DikeProfileCollectionTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -41,15 +41,15 @@ protected override IEnumerable UniqueElements() { - yield return new TestDikeProfile(string.Empty, "Dike ID A"); - yield return new TestDikeProfile(string.Empty, "Dike ID B"); + yield return DikeProfileTestFactory.CreateDikeProfile(string.Empty, "Dike ID A"); + yield return DikeProfileTestFactory.CreateDikeProfile(string.Empty, "Dike ID B"); } protected override IEnumerable SingleNonUniqueElements() { const string someId = "Dike profile"; - yield return new TestDikeProfile("Standard Dike Profile Name", someId); - yield return new TestDikeProfile("Other Dike Profile Name", someId); + yield return DikeProfileTestFactory.CreateDikeProfile("Standard Dike Profile Name", someId); + yield return DikeProfileTestFactory.CreateDikeProfile("Other Dike Profile Name", someId); } protected override void AssertSingleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) @@ -63,10 +63,10 @@ const string someId = "Dike profile"; const string someotherId = "Other dike profile"; - yield return new TestDikeProfile("Dike profile Name 1", someId); - yield return new TestDikeProfile("Dike profile Name 2", someId); - yield return new TestDikeProfile("Dike profile Name 3", someotherId); - yield return new TestDikeProfile("Dike profile Name 4", someotherId); + yield return DikeProfileTestFactory.CreateDikeProfile("Dike profile Name 1", someId); + yield return DikeProfileTestFactory.CreateDikeProfile("Dike profile Name 2", someId); + yield return DikeProfileTestFactory.CreateDikeProfile("Dike profile Name 3", someotherId); + yield return DikeProfileTestFactory.CreateDikeProfile("Dike profile Name 4", someotherId); } protected override void AssertMultipleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs =================================================================== diff -u -r6ef5e439a6d9f40ebd9926251945e0935fbbc314 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 6ef5e439a6d9f40ebd9926251945e0935fbbc314) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/DikeProfiles/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -369,17 +369,17 @@ } [Test] - public void Equals_DerivedClassWithEqualProperties_ReturnsTrue() + public void Equals_DerivedClassWithEqualProperties_ReturnsFalse() { // Setup DikeProfile profile = CreateFullyDefinedDikeProfile(); - var derivedLayer = new TestDikeProfile(profile); + var derivedProfile = new TestDikeProfile(profile); // Call - bool areEqual = profile.Equals(derivedLayer); + bool areEqual = profile.Equals(derivedProfile); // Assert - Assert.IsTrue(areEqual); + Assert.IsFalse(areEqual); } [Test] Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DikeProfileTestFactoryTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DikeProfileTestFactoryTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/DikeProfileTestFactoryTest.cs (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -0,0 +1,262 @@ +// 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.Collections.Generic; +using Core.Common.Base.Geometry; +using NUnit.Framework; +using Ringtoets.Common.Data.DikeProfiles; + +namespace Ringtoets.Common.Data.TestUtil.Test +{ + [TestFixture] + public class DikeProfileTestFactoryTest + { + [Test] + public void CreateDikeProfile_WithoutArguments_ReturnsExpectedValues() + { + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("id", dikeProfile.Id); + Assert.AreEqual("id", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithName_ReturnsExpectedValues() + { + // Setup + const string name = "A"; + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(name); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("id", dikeProfile.Id); + Assert.AreEqual(name, dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithNameAndId_ReturnsExpectedValues() + { + // Setup + const string name = "A"; + const string id = "Just an id"; + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(name, id); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual(id, dikeProfile.Id); + Assert.AreEqual(name, dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithPoint_ReturnsExpectedValues() + { + // Setup + var point = new Point2D(1.1, 2.2); + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(point); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("id", dikeProfile.Id); + Assert.AreEqual("id", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(point, dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithPointAndId_ReturnsExpectedValues() + { + // Setup + var point = new Point2D(1.1, 2.2); + const string id = "Just an id"; + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(point, id); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual(id, dikeProfile.Id); + Assert.AreEqual("name", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(point, dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithNameAndPoint_ReturnsExpectedValues() + { + // Setup + const string name = "N"; + var point = new Point2D(-12.34, 7.78); + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(name, point); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("id", dikeProfile.Id); + Assert.AreEqual(name, dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(point, dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithForeshoreGeometry_ReturnsExpectedValues() + { + // Setup + IEnumerable foreshoreProfileGeometry = new[] + { + new Point2D(0, 0), + new Point2D(1, 1), + new Point2D(2, 2) + }; + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(foreshoreProfileGeometry); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.AreEqual(foreshoreProfileGeometry, dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("name", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithForeshoreProfileAndId_ReturnsExpectedValues() + { + // Setup + const string id = "Just an id"; + IEnumerable foreshoreProfileGeometry = new[] + { + new Point2D(0, 0), + new Point2D(1, 1), + new Point2D(2, 2) + }; + + // Call + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(foreshoreProfileGeometry, id); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.IsEmpty(dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.AreEqual(foreshoreProfileGeometry, dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual(id, dikeProfile.Id); + Assert.AreEqual("name", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + + [Test] + public void CreateDikeProfile_WithDikeGeometry_ReturnsExpectedValues() + { + // Setup + IEnumerable foreshoreProfileGeometry = new[] + { + new RoughnessPoint(new Point2D(0, 0), 5), + new RoughnessPoint(new Point2D(1, 1), 6), + new RoughnessPoint(new Point2D(2, 2), 7) + }; + + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(foreshoreProfileGeometry); + + // Assert + Assert.IsNotNull(dikeProfile); + Assert.IsNotNull(dikeProfile.ForeshoreProfile); + Assert.IsNull(dikeProfile.BreakWater); + CollectionAssert.AreEqual(foreshoreProfileGeometry, dikeProfile.DikeGeometry); + Assert.AreEqual(0, dikeProfile.DikeHeight.Value); + CollectionAssert.IsEmpty(dikeProfile.ForeshoreGeometry); + Assert.IsFalse(dikeProfile.HasBreakWater); + Assert.AreEqual("id", dikeProfile.Id); + Assert.AreEqual("name", dikeProfile.Name); + Assert.AreEqual(0, dikeProfile.Orientation.Value); + Assert.AreEqual(new Point2D(0, 0), dikeProfile.WorldReferencePoint); + Assert.AreEqual(0, dikeProfile.X0); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj =================================================================== diff -u -r04f5526f955c773d4987e820e2aca2614dfbd8d8 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision 04f5526f955c773d4987e820e2aca2614dfbd8d8) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/Ringtoets.Common.Data.TestUtil.Test.csproj (.../Ringtoets.Common.Data.TestUtil.Test.csproj) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -69,7 +69,7 @@ - + Fisheye: Tag 8900f570b33f0de1a512fc5b2509771e1201672c refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestDikeProfileTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DikeProfileTestFactory.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DikeProfileTestFactory.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/DikeProfileTestFactory.cs (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -0,0 +1,157 @@ +// 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 System.Collections.Generic; +using System.Linq; +using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.DikeProfiles; + +namespace Ringtoets.Common.Data.TestUtil +{ + /// + /// Factory that creates simple instances + /// which can be used for testing. + /// + public class DikeProfileTestFactory + { + /// + /// Creates a default at the world origin. + /// + public static DikeProfile CreateDikeProfile() + { + return CreateDikeProfile(new Point2D(0, 0)); + } + + /// + /// Creates a default at the world origin + /// with a specified name. + /// + /// The name of the dike profile. + public static DikeProfile CreateDikeProfile(string name) + { + return CreateDikeProfile(name, new Point2D(0, 0)); + } + + /// + /// Creates a default at the world origin + /// with a specified name and ID. + /// + /// The name of the dike profile. + /// The ID of the dike profile. + /// Thrown when is + /// null, empty, or consists of whitespace. + public static DikeProfile CreateDikeProfile(string name, string id) + { + return CreateDikeProfile(id, name, new Point2D(0, 0), Enumerable.Empty(), Enumerable.Empty()); + } + + /// + /// Creates a default at a specified world + /// location. + /// + /// The world coordinate of the dike profile. + public static DikeProfile CreateDikeProfile(Point2D point) + { + return CreateDikeProfile(null, point); + } + + /// + /// Creates a default at a specified world + /// location and ID. + /// + /// The world coordinate of the dike profile. + /// The ID of the dike profile. + /// Thrown when is + /// null, empty, or consists of whitespace. + public static DikeProfile CreateDikeProfile(Point2D point, string id) + { + return CreateDikeProfile(id, "name", point, Enumerable.Empty(), Enumerable.Empty()); + } + + /// + /// Creates a default at the world origin with + /// a specified foreshore profile geometry. + /// + /// The geometry of the . + public static DikeProfile CreateDikeProfile(IEnumerable foreshoreProfileGeometry) + { + return CreateDikeProfile("id", "name", new Point2D(0, 0), Enumerable.Empty(), foreshoreProfileGeometry); + } + + /// + /// Creates a default at the world origin with + /// a specified foreshore profile geometry and ID. + /// + /// The geometry of the . + /// The ID of the dike profile. + /// Thrown when is + /// null, empty, or consists of whitespace. + public static DikeProfile CreateDikeProfile(IEnumerable foreshoreProfileGeometry, string id) + { + return CreateDikeProfile(id, "name", new Point2D(0, 0), Enumerable.Empty(), foreshoreProfileGeometry); + } + + /// + /// Creates a default at the world origin with + /// a specified dike profile geometry. + /// + /// The geometry of the . + public static DikeProfile CreateDikeProfile(IEnumerable dikeGeometry) + { + return CreateDikeProfile("id", "name", new Point2D(0, 0), dikeGeometry, Enumerable.Empty()); + } + + /// + /// Creates a default at the world location. + /// + /// The name of the dike profile. + /// The world coordinate of the dike profile. + public static DikeProfile CreateDikeProfile(string name, Point2D point) + { + return CreateDikeProfile("id", name, point, Enumerable.Empty(), Enumerable.Empty()); + } + + /// + /// Creates a default at the world location with + /// a specified foreshore profile geometry. + /// + /// The ID of the dike profile. + /// The name of the dike profile. + /// The world coordinate of the dike profile. + /// The geometry of the dike. + /// The geometry of the . + /// Thrown when is + /// null, empty, or consists of whitespace. + private static DikeProfile CreateDikeProfile(string id, + string name, + Point2D point, + IEnumerable dikeGeometry, + IEnumerable foreshoreProfileGeometry) + { + return new DikeProfile(point, dikeGeometry, foreshoreProfileGeometry, null, new DikeProfile.ConstructionProperties + { + Id = id, + Name = name + }); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj =================================================================== diff -u -r04f5526f955c773d4987e820e2aca2614dfbd8d8 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision 04f5526f955c773d4987e820e2aca2614dfbd8d8) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/Ringtoets.Common.Data.TestUtil.csproj (.../Ringtoets.Common.Data.TestUtil.csproj) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -74,7 +74,7 @@ - + Fisheye: Tag 8900f570b33f0de1a512fc5b2509771e1201672c refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestDikeProfile.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/TestDikeProfileUpdateStrategyTest.cs =================================================================== diff -u -r9540d67453c6a1caf5833d64ab651660dce11595 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/TestDikeProfileUpdateStrategyTest.cs (.../TestDikeProfileUpdateStrategyTest.cs) (revision 9540d67453c6a1caf5833d64ab651660dce11595) +++ Ringtoets/Common/test/Ringtoets.Common.IO.TestUtil.Test/TestDikeProfileUpdateStrategyTest.cs (.../TestDikeProfileUpdateStrategyTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -51,9 +51,9 @@ const string filePath = "path/to/dikeprofiles"; var readDikeProfiles = new[] { - new TestDikeProfile("Dike One"), - new TestDikeProfile("Dike Two"), - new TestDikeProfile("Dike Three") + DikeProfileTestFactory.CreateDikeProfile("Dike One"), + DikeProfileTestFactory.CreateDikeProfile("Dike Two"), + DikeProfileTestFactory.CreateDikeProfile("Dike Three") }; // Call Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsFailureMechanismTest.cs (.../GrassCoverErosionInwardsFailureMechanismTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -139,9 +139,9 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); const string filePath = "path"; - DikeProfile dikeProfile1 = new TestDikeProfile(new Point2D(0, 0), "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile(new Point2D(1, 1), "id2"); - DikeProfile dikeProfile3 = new TestDikeProfile(new Point2D(2, 2), "id3"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(0, 0), "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1, 1), "id2"); + DikeProfile dikeProfile3 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(2, 2), "id3"); failureMechanism.DikeProfiles.AddRange(new[] { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs =================================================================== diff -u -r07f3d67fe9512b3c8303ff09398b0a234900d546 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 07f3d67fe9512b3c8303ff09398b0a234900d546) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/GrassCoverErosionInwardsInputTest.cs (.../GrassCoverErosionInwardsInputTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -293,7 +293,7 @@ // Setup var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new[] + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(3.3, 4.4), new Point2D(5.5, 6.6) Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/GrassCoverErosionInwardsTestDataGenerator.cs =================================================================== diff -u -rd74673fe0021036105c40d4333523b8fbb0edf68 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/GrassCoverErosionInwardsTestDataGenerator.cs (.../GrassCoverErosionInwardsTestDataGenerator.cs) (revision d74673fe0021036105c40d4333523b8fbb0edf68) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.TestUtil/GrassCoverErosionInwardsTestDataGenerator.cs (.../GrassCoverErosionInwardsTestDataGenerator.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -57,7 +57,7 @@ input.ShouldDikeHeightIllustrationPointsBeCalculated = random.NextBoolean(); input.ShouldOvertoppingRateIllustrationPointsBeCalculated = random.NextBoolean(); input.ShouldOvertoppingOutputIllustrationPointsBeCalculated = random.NextBoolean(); - input.DikeProfile = new TestDikeProfile(); + input.DikeProfile = DikeProfileTestFactory.CreateDikeProfile(); input.UseBreakWater = random.NextBoolean(); input.BreakWater.Type = random.NextEnumValue(); input.BreakWater.Height = random.NextRoundedDouble(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataFactoryTest.cs =================================================================== diff -u -r6f1ebc70aa1b4b5cf7242b4f4c94f61ba79a5788 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataFactoryTest.cs (.../GrassCoverErosionInwardsChartDataFactoryTest.cs) (revision 6f1ebc70aa1b4b5cf7242b4f4c94f61ba79a5788) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataFactoryTest.cs (.../GrassCoverErosionInwardsChartDataFactoryTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -73,7 +73,7 @@ { // Setup var chartData = new ChartLineData("test name"); - DikeProfile dikeProfile = new TestDikeProfile("dike profile name"); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile("dike profile name"); // Call GrassCoverErosionInwardsChartDataFactory.UpdateDikeGeometryChartDataName(chartData, dikeProfile); @@ -120,7 +120,7 @@ var chartData = new ChartLineData("test name"); var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile("dike profile name"), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile("dike profile name"), UseForeshore = false }; @@ -138,7 +138,7 @@ var chartData = new ChartLineData("test name"); var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile("dike profile name"), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile("dike profile name"), UseForeshore = true }; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs =================================================================== diff -u -rf1f94637a6b45b394493bf16a078b317c02d329b -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs (.../GrassCoverErosionInwardsChartDataPointsFactoryTest.cs) (revision f1f94637a6b45b394493bf16a078b317c02d329b) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsChartDataPointsFactoryTest.cs (.../GrassCoverErosionInwardsChartDataPointsFactoryTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -52,7 +52,7 @@ new RoughnessPoint(new Point2D(1.1, 2.2), 0.5), new RoughnessPoint(new Point2D(3.3, 4.4), 0.6) }; - var dikeProfile = new TestDikeProfile(roughnessPoints); + var dikeProfile = DikeProfileTestFactory.CreateDikeProfile(roughnessPoints); // Call Point2D[] points = GrassCoverErosionInwardsChartDataPointsFactory.CreateDikeGeometryPoints(dikeProfile); @@ -93,7 +93,7 @@ // Setup var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new[] + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(1.1, 2.2), new Point2D(3.3, 4.4) @@ -119,7 +119,7 @@ }; var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(foreshoreGeometry), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(foreshoreGeometry), UseForeshore = true }; @@ -146,7 +146,7 @@ // Setup var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new[] + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new RoughnessPoint(new Point2D(1.1, 2.2), 0.5), new RoughnessPoint(new Point2D(3.3, 4.4), 0.6) @@ -167,7 +167,7 @@ // Setup var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new[] + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new RoughnessPoint(new Point2D(1.1, 2.2), 0.5) }), @@ -187,7 +187,7 @@ // Setup var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile( + DikeProfile = DikeProfileTestFactory.CreateDikeProfile( new[] { new RoughnessPoint(new Point2D(1.1, 2.2), 0.5), Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsMapDataFeaturesFactoryTest.cs =================================================================== diff -u -r4b8ab1201eba50035392ce074fa1cc5da25ff4a7 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsMapDataFeaturesFactoryTest.cs (.../GrassCoverErosionInwardsMapDataFeaturesFactoryTest.cs) (revision 4b8ab1201eba50035392ce074fa1cc5da25ff4a7) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Factories/GrassCoverErosionInwardsMapDataFeaturesFactoryTest.cs (.../GrassCoverErosionInwardsMapDataFeaturesFactoryTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -62,8 +62,8 @@ var calculationA = new GrassCoverErosionInwardsCalculation(); var calculationB = new GrassCoverErosionInwardsCalculation(); - calculationA.InputParameters.DikeProfile = new TestDikeProfile(new Point2D(1.0, 3.0)); - calculationB.InputParameters.DikeProfile = new TestDikeProfile(new Point2D(1.0, 4.0)); + calculationA.InputParameters.DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.0, 3.0)); + calculationB.InputParameters.DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.0, 4.0)); calculationA.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 5.0, 4.0); calculationB.InputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 2.2, 3.8); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs =================================================================== diff -u -rfe90a6d174a01975381e6cda55ed1f7f4e831a51 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision fe90a6d174a01975381e6cda55ed1f7f4e831a51) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs (.../GrassCoverErosionInwardsDikeProfileSelectionDialogTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -117,9 +117,9 @@ // Call using (var viewParent = new Form()) - using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, new DikeProfile[] + using (var dialog = new GrassCoverErosionInwardsDikeProfileSelectionDialog(viewParent, new[] { - new TestDikeProfile(testname) + DikeProfileTestFactory.CreateDikeProfile(testname) })) { // Assert Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfileDikeGeometryPropertiesTest.cs =================================================================== diff -u -r081badaad87a6e2a6d5c861de9ee95fa1ca6dea3 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfileDikeGeometryPropertiesTest.cs (.../DikeProfileDikeGeometryPropertiesTest.cs) (revision 081badaad87a6e2a6d5c861de9ee95fa1ca6dea3) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfileDikeGeometryPropertiesTest.cs (.../DikeProfileDikeGeometryPropertiesTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -53,7 +53,7 @@ public void Data_SetNewDikeProfileInstance_ReturnCorrectPropertyValues() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var properties = new DikeProfileDikeGeometryProperties(); // Call @@ -68,7 +68,7 @@ public void Data_SetDikeProfileInstanceWithData_ReturnCorrectPropertyValues() { // Setup - var dikeProfile = new TestDikeProfile(new[] + var dikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new RoughnessPoint(new Point2D(0, 0), 0.6), new RoughnessPoint(new Point2D(1, 1), 0.7) @@ -98,7 +98,7 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); // Call var properties = new DikeProfileDikeGeometryProperties Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs =================================================================== diff -u -r05dbdd1382bbe32c4c1519918c0aaecb29f5423a -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs (.../DikeProfilePropertiesTest.cs) (revision 05dbdd1382bbe32c4c1519918c0aaecb29f5423a) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/DikeProfilePropertiesTest.cs (.../DikeProfilePropertiesTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -94,7 +94,7 @@ public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); // Call var properties = new DikeProfileProperties Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs =================================================================== diff -u -r081badaad87a6e2a6d5c861de9ee95fa1ca6dea3 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision 081badaad87a6e2a6d5c861de9ee95fa1ca6dea3) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextDikeGeometryPropertiesTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -89,7 +89,7 @@ mockRepository.ReplayAll(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); - var dikeProfile = new TestDikeProfile(new[] + var dikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new RoughnessPoint(new Point2D(1.1, 2.2), 0.6), new RoughnessPoint(new Point2D(3.3, 4.4), 0.7) Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs =================================================================== diff -u -rd485f27eb5a6d688406882dce60c3229e22f2ac2 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision d485f27eb5a6d688406882dce60c3229e22f2ac2) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/PropertyClasses/GrassCoverErosionInwardsInputContextPropertiesTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -191,7 +191,7 @@ var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new Point2D(12.34, 56.78)), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(12.34, 56.78)), HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "", 0, 0) }; var inputContext = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection); @@ -256,7 +256,7 @@ [Test] public void DikeProfile_Always_InputChangedAndObservablesNotified() { - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); SetPropertyAndVerifyNotificationsAndOutput(properties => properties.DikeProfile = dikeProfile); } @@ -365,7 +365,7 @@ var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile(new Point2D(200620.173572981, 503401.652985217)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(200620.173572981, 503401.652985217)) }; var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -402,7 +402,7 @@ var input = new GrassCoverErosionInwardsInput { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = new TestDikeProfile(new Point2D(200620.173572981, 503401.652985217)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(200620.173572981, 503401.652985217)) }; var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -443,7 +443,7 @@ var input = new GrassCoverErosionInwardsInput { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = new TestDikeProfile(new Point2D(200620.173572981, 503401.652985217)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(200620.173572981, 503401.652985217)) }; var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -519,7 +519,7 @@ var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() }; var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -561,9 +561,9 @@ mockRepository.ReplayAll(); var input = new GrassCoverErosionInwardsInput { - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() }; - var otherProfile = new TestDikeProfile(new Point2D(0.0, 190.0)); + DikeProfile otherProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(0.0, 190.0)); var calculation = new GrassCoverErosionInwardsCalculation(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -606,7 +606,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }, "path"); var inputContext = new GrassCoverErosionInwardsInputContext(input, calculation, failureMechanism, assessmentSection); @@ -635,7 +635,7 @@ if (withDikeProfile) { - input.DikeProfile = new TestDikeProfile(); + input.DikeProfile = DikeProfileTestFactory.CreateDikeProfile(); } if (calculationsEnabled) @@ -826,7 +826,7 @@ var input = new GrassCoverErosionInwardsInput { DikeProfile = hasDikeProfile - ? new TestDikeProfile() + ? DikeProfileTestFactory.CreateDikeProfile() : null }; @@ -857,7 +857,7 @@ var input = new GrassCoverErosionInwardsInput { DikeProfile = hasDikeProfile - ? new TestDikeProfile() + ? DikeProfileTestFactory.CreateDikeProfile() : null }; @@ -884,7 +884,7 @@ var calculation = new GrassCoverErosionInwardsCalculation(); GrassCoverErosionInwardsInput input = calculation.InputParameters; - input.DikeProfile = new TestDikeProfile(); + input.DikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs =================================================================== diff -u -r1bbf51443c907b5f202e80764fa05f2e7f842c04 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision 1bbf51443c907b5f202e80764fa05f2e7f842c04) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/UITypeEditors/GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs (.../GrassCoverErosionInwardsInputContextDikeProfileEditorTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -54,7 +54,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }, "path"); var grassCoverErosionInwardsInput = new GrassCoverErosionInwardsInput(); var grassCoverErosionInwardsCalculation = new GrassCoverErosionInwardsCalculation(); @@ -93,7 +93,7 @@ public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() { // Setup - DikeProfile dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs =================================================================== diff -u -r69ba77aac3b14ca0060f5788121f36f5fd19c83f -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 69ba77aac3b14ca0060f5788121f36f5fd19c83f) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsFailureMechanismViewTest.cs (.../GrassCoverErosionInwardsFailureMechanismViewTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -219,8 +219,8 @@ ReferenceLine = referenceLine }; - var dikeProfileA = new TestDikeProfile(new Point2D(1.3, 1.3)); - var dikeProfileB = new TestDikeProfile(new Point2D(1.5, 1.5)); + DikeProfile dikeProfileA = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.3, 1.3)); + DikeProfile dikeProfileB = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.5, 1.5)); var calculationA = new GrassCoverErosionInwardsCalculation { @@ -246,12 +246,12 @@ failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile(new[] + DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(0, 0), new Point2D(1, 1) }, "id1"), - new TestDikeProfile(new[] + DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(2, 2), new Point2D(3, 3) @@ -565,7 +565,7 @@ failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile(string.Empty, "id1") + DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id1") }, "path"); view.Data = failureMechanismContext; @@ -583,7 +583,7 @@ // When failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile(string.Empty, "id2") + DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id2") }, "path"); failureMechanism.DikeProfiles.NotifyObservers(); @@ -604,7 +604,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - var dikeProfile = new TestDikeProfile(string.Empty, "id1"); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id1"); failureMechanism.DikeProfiles.AddRange(new[] { dikeProfile @@ -624,7 +624,7 @@ AssertDikeProfiles(failureMechanism.DikeProfiles, dikeProfileData); // When - var dikeProfileToUpdateFrom = new TestDikeProfile("A new name", "id1"); + DikeProfile dikeProfileToUpdateFrom = DikeProfileTestFactory.CreateDikeProfile("A new name", "id1"); dikeProfile.CopyProperties(dikeProfileToUpdateFrom); dikeProfile.NotifyObservers(); @@ -645,7 +645,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - var dikeProfile = new TestDikeProfile(new[] + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(0, 0), new Point2D(1, 1) @@ -669,7 +669,7 @@ MapDataTestHelper.AssertForeshoreProfilesMapData(failureMechanism.DikeProfiles.Select(dp => dp.ForeshoreProfile), dikeProfileData); // When - var dikeProfileToUpdateFrom = new TestDikeProfile(new[] + DikeProfile dikeProfileToUpdateFrom = DikeProfileTestFactory.CreateDikeProfile(new[] { new Point2D(2, 2), new Point2D(3, 3) @@ -694,8 +694,8 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); var failureMechanismContext = new GrassCoverErosionInwardsFailureMechanismContext(failureMechanism, new ObservableTestAssessmentSectionStub()); - var dikeProfileA = new TestDikeProfile(new Point2D(1.3, 1.3)); - var dikeProfileB = new TestDikeProfile(new Point2D(1.5, 1.5)); + DikeProfile dikeProfileA = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.3, 1.3)); + DikeProfile dikeProfileB = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.5, 1.5)); var calculationA = new GrassCoverErosionInwardsCalculation { @@ -741,8 +741,8 @@ { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var dikeProfileA = new TestDikeProfile(new Point2D(1.3, 1.3)); - var dikeProfileB = new TestDikeProfile(new Point2D(1.5, 1.5)); + DikeProfile dikeProfileA = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.3, 1.3)); + DikeProfile dikeProfileB = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.5, 1.5)); var calculationA = new GrassCoverErosionInwardsCalculation { @@ -783,7 +783,7 @@ { IMapControl map = ((RingtoetsMapControl) view.Controls[0]).MapControl; - var dikeProfileA = new TestDikeProfile(new Point2D(1.3, 1.3)); + DikeProfile dikeProfileA = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.3, 1.3)); var calculationA = new GrassCoverErosionInwardsCalculation { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenariosViewTest.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenariosViewTest.cs (.../GrassCoverErosionInwardsScenariosViewTest.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Views/GrassCoverErosionInwardsScenariosViewTest.cs (.../GrassCoverErosionInwardsScenariosViewTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -358,15 +358,15 @@ Name = "CalculationA", InputParameters = { - DikeProfile = new TestDikeProfile(matchingPointA) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(matchingPointA) } }; var calculationB = new GrassCoverErosionInwardsCalculation { Name = "CalculationB", InputParameters = { - DikeProfile = new TestDikeProfile(matchingPointB) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(matchingPointB) } }; var connectionPoint = new Point2D(10, 10); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs =================================================================== diff -u -ref881721312166028ed88eaa21dfd1ee8a5cbba4 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs) (revision ef881721312166028ed88eaa21dfd1ee8a5cbba4) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.IO.Test/Configurations/GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs (.../GrassCoverErosionInwardsCalculationConfigurationImporterTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -124,7 +124,7 @@ Enumerable.Empty(), new[] { - new TestDikeProfile("Dijkprofiel", "Dijkprofiel ID") + DikeProfileTestFactory.CreateDikeProfile("Dijkprofiel", "Dijkprofiel ID") }, new GrassCoverErosionInwardsFailureMechanism()); @@ -328,7 +328,7 @@ string filePath = Path.Combine(path, "validConfigurationCalculationUseForeshoreWithoutGeometry.xml"); var calculationGroup = new CalculationGroup(); - var dikeProfile = new TestDikeProfile("Dijkprofiel", "Dijkprofiel ID"); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile("Dijkprofiel", "Dijkprofiel ID"); var importer = new GrassCoverErosionInwardsCalculationConfigurationImporter( filePath, calculationGroup, @@ -358,7 +358,7 @@ var calculationGroup = new CalculationGroup(); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "HRlocatie", 10, 20); - var dikeProfile = new TestDikeProfile("Dijkprofiel", "Dijkprofiel ID"); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile("Dijkprofiel", "Dijkprofiel ID"); var importer = new GrassCoverErosionInwardsCalculationConfigurationImporter( filePath, @@ -591,7 +591,7 @@ { InputParameters = { - DikeProfile = new TestDikeProfile(new Point2D(5, 5)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(5, 5)) } }; failureMechanism.CalculationsGroup.Children.Add( Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs =================================================================== diff -u -rd337718251f4330d447d555eb1c70df226dd9823 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs) (revision d337718251f4330d447d555eb1c70df226dd9823) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Integration.Test/GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs (.../GrassCoverErosionInwardsInputContextPropertiesIntegrationTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -54,8 +54,8 @@ var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); - DikeProfile dikeProfile1 = new TestDikeProfile(new Point2D(0.51, 0.51), "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile(new Point2D(1.51, 1.51), "id2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(0.51, 0.51), "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.51, 1.51), "id2"); var calculation = new GrassCoverErosionInwardsCalculation { @@ -110,8 +110,8 @@ var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll(); - DikeProfile dikeProfile1 = new TestDikeProfile(new Point2D(0.51, 0.51), "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile(new Point2D(1.51, 1.51), "id2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(0.51, 0.51), "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.51, 1.51), "id2"); var calculation1 = new GrassCoverErosionInwardsCalculation { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileReplaceDataStrategyTest.cs =================================================================== diff -u -r9540d67453c6a1caf5833d64ab651660dce11595 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileReplaceDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileReplaceDataStrategyTest.cs) (revision 9540d67453c6a1caf5833d64ab651660dce11595) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileReplaceDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileReplaceDataStrategyTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -123,7 +123,7 @@ // Setup var importedDikeProfiles = new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }; var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -146,14 +146,14 @@ public void UpdateDikeProfilesWithImportedData_CollectionAndImportedDataCollectionNotEmpty_ReplacesCurrentWithImportedData() { // Setup - var targetDikeProfile = new TestDikeProfile("Name A", "Name A ID"); + DikeProfile targetDikeProfile = DikeProfileTestFactory.CreateDikeProfile("Name A", "Name A ID"); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { targetDikeProfile }, sourceFilePath); - var readDikeProfile = new TestDikeProfile("Name B", "Name B ID"); + DikeProfile readDikeProfile = DikeProfileTestFactory.CreateDikeProfile("Name B", "Name B ID"); var strategy = new GrassCoverErosionInwardsDikeProfileReplaceDataStrategy(failureMechanism); @@ -183,8 +183,8 @@ const string duplicateId = "Duplicate ID it is"; DikeProfile[] importedSurfaceLines = { - new TestDikeProfile("Naam A", duplicateId), - new TestDikeProfile("Naam B", duplicateId) + DikeProfileTestFactory.CreateDikeProfile("Naam A", duplicateId), + DikeProfileTestFactory.CreateDikeProfile("Naam B", duplicateId) }; var strategy = new GrassCoverErosionInwardsDikeProfileReplaceDataStrategy(new GrassCoverErosionInwardsFailureMechanism()); @@ -203,7 +203,7 @@ public void UpdateDikeProfilesWithImportedData_CalculationWithOutputAndDikeProfile_CalculationUpdatedAndReturnsAffectedObjects() { // Setup - var existingDikeProfile = new TestDikeProfile("test", "ID1"); + DikeProfile existingDikeProfile = DikeProfileTestFactory.CreateDikeProfile("test", "ID1"); var calculation = new GrassCoverErosionInwardsCalculation { @@ -246,7 +246,7 @@ const string dikeProfileId = "ID of removed profile"; var matchingPoint = new Point2D(0, 0); - var removedProfile = new TestDikeProfile(matchingPoint, dikeProfileId); + DikeProfile removedProfile = DikeProfileTestFactory.CreateDikeProfile(matchingPoint, dikeProfileId); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs =================================================================== diff -u -ra940166534b3dd6e778de2e7c8e7e5241f3d3381 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs) (revision a940166534b3dd6e778de2e7c8e7e5241f3d3381) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/FileImporters/GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs (.../GrassCoverErosionInwardsDikeProfileUpdateDataStrategyTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -101,7 +101,7 @@ public void UpdateDikeProfilesWithImportedData_DikeProfilePropertiesChanged_UpdateRelevantProperties() { // Setup - var dikeProfileToUpdate = new TestDikeProfile("name", "ID A"); + DikeProfile dikeProfileToUpdate = DikeProfileTestFactory.CreateDikeProfile("name", "ID A"); DikeProfile dikeProfileToUpdateFrom = DeepCloneAndModify(dikeProfileToUpdate); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); @@ -129,8 +129,8 @@ { // Setup const string duplicateId = "A duplicated ID"; - var dikeProfileOne = new TestDikeProfile("name one", duplicateId); - var dikeProfileTwo = new TestDikeProfile("Another dike profile", duplicateId); + DikeProfile dikeProfileOne = DikeProfileTestFactory.CreateDikeProfile("name one", duplicateId); + DikeProfile dikeProfileTwo = DikeProfileTestFactory.CreateDikeProfile("Another dike profile", duplicateId); var targetCollection = new DikeProfileCollection(); var strategy = new GrassCoverErosionInwardsDikeProfileUpdateDataStrategy(new GrassCoverErosionInwardsFailureMechanism()); @@ -156,7 +156,7 @@ { // Setup const string duplicateId = "A duplicated ID"; - var expectedDikeProfile = new TestDikeProfile("expectedName", duplicateId); + DikeProfile expectedDikeProfile = DikeProfileTestFactory.CreateDikeProfile("expectedName", duplicateId); var targetCollection = new DikeProfileCollection(); var expectedTargetCollection = new[] @@ -191,7 +191,7 @@ { // Setup const string id = "Just an ID"; - var targetDikeProfile = new TestDikeProfile("name", id); + DikeProfile targetDikeProfile = DikeProfileTestFactory.CreateDikeProfile("name", id); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); DikeProfileCollection targetCollection = failureMechanism.DikeProfiles; @@ -229,10 +229,10 @@ { // Setup const string currentDikeProfileId = "Current ID"; - var targetDikeProfile = new TestDikeProfile(string.Empty, currentDikeProfileId); + DikeProfile targetDikeProfile = DikeProfileTestFactory.CreateDikeProfile(string.Empty, currentDikeProfileId); const string readDikeProfileId = "Read ID"; - var readDikeProfile = new TestDikeProfile(string.Empty, readDikeProfileId); + DikeProfile readDikeProfile = DikeProfileTestFactory.CreateDikeProfile(string.Empty, readDikeProfileId); var readDikeProfiles = new[] { readDikeProfile @@ -270,8 +270,8 @@ const string updatedDikeProfileId = "ID C"; const string commonName = "Just a name for dike profile"; - var dikeProfileToBeRemoved = new TestDikeProfile(commonName, removedDikeProfileId); - var dikeProfileToBeUpdated = new TestDikeProfile(commonName, updatedDikeProfileId); + DikeProfile dikeProfileToBeRemoved = DikeProfileTestFactory.CreateDikeProfile(commonName, removedDikeProfileId); + DikeProfile dikeProfileToBeUpdated = DikeProfileTestFactory.CreateDikeProfile(commonName, updatedDikeProfileId); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); DikeProfileCollection dikeProfiles = failureMechanism.DikeProfiles; @@ -282,7 +282,7 @@ }, sourceFilePath); DikeProfile dikeProfileToUpdateFrom = DeepCloneAndModify(dikeProfileToBeUpdated); - var dikeProfileToBeAdded = new TestDikeProfile(commonName, addedDikeProfileId); + DikeProfile dikeProfileToBeAdded = DikeProfileTestFactory.CreateDikeProfile(commonName, addedDikeProfileId); var readDikeProfiles = new[] { dikeProfileToBeAdded, @@ -323,7 +323,7 @@ public void UpdateDikeProfilesWithImportedData_CalculationWithOutputAssignedToRemovedProfile_UpdatesCalculation() { // Setup - var profileToBeRemoved = new TestDikeProfile("Removed profile", "removed profile ID"); + DikeProfile profileToBeRemoved = DikeProfileTestFactory.CreateDikeProfile("Removed profile", "removed profile ID"); var calculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -363,7 +363,7 @@ public void UpdateDikeProfilesWithImportedData_MultipleCalculationWithAssignedProfile_OnlyUpdatesCalculationWithUpdatedProfile() { // Setup - var affectedProfile = new TestDikeProfile("Profile to be updated", "ID of updated profile"); + DikeProfile affectedProfile = DikeProfileTestFactory.CreateDikeProfile("Profile to be updated", "ID of updated profile"); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -375,7 +375,7 @@ const string unaffectedProfileName = "Unaffected Profile"; const string unaffectedProfileId = "unaffected profile Id"; - var unaffectedProfile = new TestDikeProfile(unaffectedProfileName, unaffectedProfileId); + DikeProfile unaffectedProfile = DikeProfileTestFactory.CreateDikeProfile(unaffectedProfileName, unaffectedProfileId); var unaffectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -396,7 +396,7 @@ failureMechanism.CalculationsGroup.Children.Add(unaffectedCalculation); DikeProfile importedAffectedProfile = DeepCloneAndModify(affectedProfile); - var importedUnaffectedProfile = new TestDikeProfile(unaffectedProfileName, unaffectedProfileId); + DikeProfile importedUnaffectedProfile = DikeProfileTestFactory.CreateDikeProfile(unaffectedProfileName, unaffectedProfileId); var strategy = new GrassCoverErosionInwardsDikeProfileUpdateDataStrategy(failureMechanism); @@ -430,7 +430,7 @@ public void UpdateDikeProfilesWithImportedData_MultipleCalculationWithAssignedProfileOneRemovedProfile_OnlyUpdatesCalculationWithRemovedProfile() { // Setup - var removedProfile = new TestDikeProfile("Profile to be removed", "ID of removed profile"); + DikeProfile removedProfile = DikeProfileTestFactory.CreateDikeProfile("Profile to be removed", "ID of removed profile"); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -442,7 +442,7 @@ const string unaffectedProfileName = "Unaffected Profile"; const string unaffectedProfileId = "unaffected profile Id"; - var unaffectedProfile = new TestDikeProfile(unaffectedProfileName, unaffectedProfileId); + DikeProfile unaffectedProfile = DikeProfileTestFactory.CreateDikeProfile(unaffectedProfileName, unaffectedProfileId); var unaffectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -462,7 +462,7 @@ failureMechanism.CalculationsGroup.Children.Add(affectedCalculation); failureMechanism.CalculationsGroup.Children.Add(unaffectedCalculation); - var importedUnaffectedProfile = new TestDikeProfile(unaffectedProfileName, unaffectedProfileId); + DikeProfile importedUnaffectedProfile = DikeProfileTestFactory.CreateDikeProfile(unaffectedProfileName, unaffectedProfileId); var strategy = new GrassCoverErosionInwardsDikeProfileUpdateDataStrategy(failureMechanism); @@ -492,7 +492,7 @@ public void UpdateDikeProfilesWithImportedData_CalculationWithSameReference_OnlyReturnsDistinctCalculation() { // Setup - var affectedProfile = new TestDikeProfile("Profile to be updated", "ID of updated profile"); + DikeProfile affectedProfile = DikeProfileTestFactory.CreateDikeProfile("Profile to be updated", "ID of updated profile"); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -537,7 +537,7 @@ const string dikeProfileId = "ID of updated profile"; var originalMatchingPoint = new Point2D(0, 0); - var affectedProfile = new TestDikeProfile(originalMatchingPoint, dikeProfileId); + DikeProfile affectedProfile = DikeProfileTestFactory.CreateDikeProfile(originalMatchingPoint, dikeProfileId); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -579,7 +579,7 @@ Assert.AreSame(affectedCalculation, sectionResults[0].Calculation); Assert.IsNull(sectionResults[1].Calculation); - DikeProfile profileToUpdateFrom = new TestDikeProfile(updatedMatchingPoint, dikeProfileId); + DikeProfile profileToUpdateFrom = DikeProfileTestFactory.CreateDikeProfile(updatedMatchingPoint, dikeProfileId); var strategy = new GrassCoverErosionInwardsDikeProfileUpdateDataStrategy(failureMechanism); @@ -611,7 +611,7 @@ const string dikeProfileId = "ID of removed profile"; var matchingPoint = new Point2D(0, 0); - var removedProfile = new TestDikeProfile(matchingPoint, dikeProfileId); + DikeProfile removedProfile = DikeProfileTestFactory.CreateDikeProfile(matchingPoint, dikeProfileId); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -675,7 +675,7 @@ new Point2D(3, 4) }; - var affectedProfile = new TestDikeProfile(geometry, id); + DikeProfile affectedProfile = DikeProfileTestFactory.CreateDikeProfile(geometry, id); var affectedCalculation = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -686,7 +686,7 @@ }; affectedCalculation.InputParameters.UseForeshore = true; - var profileToUpdateFrom = new TestDikeProfile(Enumerable.Empty(), id); + DikeProfile profileToUpdateFrom = DikeProfileTestFactory.CreateDikeProfile(Enumerable.Empty(), id); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs =================================================================== diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs (.../DikeProfilesContextTreeNodeInfoTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/DikeProfilesContextTreeNodeInfoTest.cs (.../DikeProfilesContextTreeNodeInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -134,7 +134,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }, "path"); // Precondition @@ -158,8 +158,8 @@ var assessmentSection = mocks.Stub(); mocks.ReplayAll(); - DikeProfile dikeProfile1 = new TestDikeProfile(string.Empty, "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile(string.Empty, "id2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile(string.Empty, "id2"); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationContextTreeNodeInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -313,7 +313,7 @@ { InputParameters = { - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); @@ -348,13 +348,13 @@ // Setup var assessmentSection = mocks.Stub(); - var testDikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation { InputParameters = { - DikeProfile = testDikeProfile + DikeProfile = dikeProfile } }; var failureMechanism = new TestGrassCoverErosionInwardsFailureMechanism(); @@ -369,7 +369,7 @@ plugin.Gui = gui; - ChangeDikeProfile(testDikeProfile); + ChangeDikeProfile(dikeProfile); // Call using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, assessmentSection, treeViewControl)) @@ -389,7 +389,7 @@ { // Given var assessmentSection = mocks.Stub(); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation { @@ -438,7 +438,7 @@ { // Given var assessmentSection = mocks.Stub(); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation { @@ -502,7 +502,7 @@ // Given var assessmentSection = mocks.Stub(); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionInwardsCalculation { @@ -882,7 +882,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -961,7 +961,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -1045,7 +1045,7 @@ new Point2D(0.0, 0.0), new Point2D(1.0, 1.0) })); - DikeProfile dikeProfile = new TestDikeProfile(new Point2D(0.5, 0.5)); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(0.5, 0.5)); failureMechanism.DikeProfiles.AddRange(new[] { dikeProfile Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -572,7 +572,7 @@ { InputParameters = { - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } } } @@ -609,7 +609,7 @@ public void ContextMenuStrip_CalculationGroupWithCalculationWithDikeProfileAndInputOutOfSync_ContextMenuItemUpdateDikeProfilesEnabledAndToolTipSet() { // Setup - var testDikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var group = new CalculationGroup { Children = @@ -618,7 +618,7 @@ { InputParameters = { - DikeProfile = testDikeProfile + DikeProfile = dikeProfile } } } @@ -638,7 +638,7 @@ plugin.Gui = gui; - ChangeDikeProfile(testDikeProfile); + ChangeDikeProfile(dikeProfile); // Call using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) @@ -664,7 +664,7 @@ var calculation1Observer = mocks.StrictMock(); var calculation2Observer = mocks.StrictMock(); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var calculation1 = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -736,7 +736,7 @@ var calculation1Observer = mocks.StrictMock(); var calculation2Observer = mocks.StrictMock(); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var calculation1 = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -828,7 +828,7 @@ var calculation2Observer = mocks.StrictMock(); calculation2Observer.Expect(obs => obs.UpdateObserver()); - var dikeProfile = new TestDikeProfile(); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var calculation1 = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -1306,7 +1306,7 @@ var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }, dikeProfileCollectionPath); var assessmentSection = mocks.Stub(); @@ -1349,7 +1349,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation @@ -1358,7 +1358,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); @@ -1418,7 +1418,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation @@ -1427,7 +1427,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); @@ -1600,8 +1600,8 @@ var assessmentSection = mocks.Stub(); - DikeProfile dikeProfile1 = new TestDikeProfile("Dike profile 1", "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile("Dike profile 2", "id2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile("Dike profile 1", "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile("Dike profile 2", "id2"); var existingCalculationGroup = new CalculationGroup(); var existingCalculation = new GrassCoverErosionInwardsCalculation(); @@ -1671,8 +1671,8 @@ // Given var assessmentSection = mocks.Stub(); - DikeProfile dikeProfile1 = new TestDikeProfile("Dike profile 1", "id1"); - DikeProfile dikeProfile2 = new TestDikeProfile("Dike profile 2", "id2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile("Dike profile 1", "id1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile("Dike profile 2", "id2"); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] @@ -1729,7 +1729,7 @@ var assessmentSection = mocks.Stub(); const string existingCalculationName = "Dike profile"; - DikeProfile dikeProfile = new TestDikeProfile(existingCalculationName); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(existingCalculationName); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism { Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -rf8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision f8c28b3b04cdabb62ea37772efcb1f4ebbbf2b9e) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismContextTreeNodeInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -721,7 +721,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation @@ -730,7 +730,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); @@ -811,7 +811,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); failureMechanism.CalculationsGroup.Children.Add(new GrassCoverErosionInwardsCalculation @@ -820,7 +820,7 @@ InputParameters = { HydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/UpdateInfos/DikeProfilesContextUpdateInfoTest.cs =================================================================== diff -u -rd337718251f4330d447d555eb1c70df226dd9823 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/UpdateInfos/DikeProfilesContextUpdateInfoTest.cs (.../DikeProfilesContextUpdateInfoTest.cs) (revision d337718251f4330d447d555eb1c70df226dd9823) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/UpdateInfos/DikeProfilesContextUpdateInfoTest.cs (.../DikeProfilesContextUpdateInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -293,7 +293,7 @@ var surfaceLines = new DikeProfileCollection(); surfaceLines.AddRange(new[] { - new TestDikeProfile() + DikeProfileTestFactory.CreateDikeProfile() }, expectedFilePath); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs =================================================================== diff -u -r571bf6cd20fe3f02f6fe5a51495c3336e226cbbb -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (.../GrassCoverErosionInwardsCalculationServiceTest.cs) (revision 571bf6cd20fe3f02f6fe5a51495c3336e226cbbb) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Service.Test/GrassCoverErosionInwardsCalculationServiceTest.cs (.../GrassCoverErosionInwardsCalculationServiceTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -67,7 +67,7 @@ { InputParameters = { - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -108,7 +108,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -151,7 +151,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -192,7 +192,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -434,7 +434,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -476,7 +476,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -518,7 +518,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -887,7 +887,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile() + DikeProfile = DikeProfileTestFactory.CreateDikeProfile() } }; @@ -936,7 +936,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile(), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(), DikeHeightCalculationType = dikeHeightCalculationType } }; @@ -996,7 +996,7 @@ InputParameters = { HydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2, 2), - DikeProfile = new TestDikeProfile(), + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(), OvertoppingRateCalculationType = overtoppingRateCalculationType } }; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs =================================================================== diff -u -r50051daeae0e7195d2cc72d704e8efd81e442f39 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionInwardsDataSynchronizationServiceTest.cs) (revision 50051daeae0e7195d2cc72d704e8efd81e442f39) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsDataSynchronizationServiceTest.cs (.../GrassCoverErosionInwardsDataSynchronizationServiceTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -301,7 +301,7 @@ { // Setup var locationRemovedProfile = new Point2D(0, 0); - var removedProfile = new TestDikeProfile(locationRemovedProfile, "RemovedProfileId"); + DikeProfile removedProfile = DikeProfileTestFactory.CreateDikeProfile(locationRemovedProfile, "RemovedProfileId"); var calculationWitRemovedProfile = new GrassCoverErosionInwardsCalculation { @@ -374,7 +374,7 @@ { // Call TestDelegate call = () => - GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(new TestDikeProfile(), + GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(DikeProfileTestFactory.CreateDikeProfile(), null, new DikeProfileCollection(), Enumerable.Empty()); @@ -389,7 +389,7 @@ { // Call TestDelegate call = () => - GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(new TestDikeProfile(), + GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(DikeProfileTestFactory.CreateDikeProfile(), Enumerable.Empty(), null, Enumerable.Empty()); @@ -404,7 +404,7 @@ { // Call TestDelegate call = () => - GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(new TestDikeProfile(), + GrassCoverErosionInwardsDataSynchronizationService.RemoveDikeProfile(DikeProfileTestFactory.CreateDikeProfile(), Enumerable.Empty(), new DikeProfileCollection(), null); @@ -471,7 +471,7 @@ const string profileToKeepId = "UnaffectedProfileId"; var locationRemovedProfile = new Point2D(0, 0); - var removedProfile = new TestDikeProfile(locationRemovedProfile, profileToBeRemovedId); + DikeProfile removedProfile = DikeProfileTestFactory.CreateDikeProfile(locationRemovedProfile, profileToBeRemovedId); var calculationWitRemovedProfile = new GrassCoverErosionInwardsCalculation { @@ -482,7 +482,7 @@ }; var locationUnaffectedProfile = new Point2D(5, 5); - var unaffectedProfile = new TestDikeProfile(locationUnaffectedProfile, profileToKeepId); + DikeProfile unaffectedProfile = DikeProfileTestFactory.CreateDikeProfile(locationUnaffectedProfile, profileToKeepId); var calculationWithProfileToKeep = new GrassCoverErosionInwardsCalculation { InputParameters = @@ -553,14 +553,14 @@ private static GrassCoverErosionInwardsFailureMechanism CreateFullyConfiguredFailureMechanism() { - var testDikeProfile1 = new TestDikeProfile("Profile 1", "ID 1"); - var testDikeProfile2 = new TestDikeProfile("Profile 2", "ID 2"); + DikeProfile dikeProfile1 = DikeProfileTestFactory.CreateDikeProfile("Profile 1", "ID 1"); + DikeProfile dikeProfile2 = DikeProfileTestFactory.CreateDikeProfile("Profile 2", "ID 2"); var failureMechanism = new GrassCoverErosionInwardsFailureMechanism(); failureMechanism.DikeProfiles.AddRange(new[] { - testDikeProfile1, - testDikeProfile2 + dikeProfile1, + dikeProfile2 }, "some/path/to/dikeprofiles"); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, string.Empty, 0, 0); @@ -594,22 +594,22 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = testDikeProfile1 + DikeProfile = dikeProfile1 } }; var calculationWithDikeProfile = new GrassCoverErosionInwardsCalculation { InputParameters = { - DikeProfile = testDikeProfile2 + DikeProfile = dikeProfile2 } }; var calculationWithOutputHydraulicBoundaryLocationAndDikeProfile = new GrassCoverErosionInwardsCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = testDikeProfile1 + DikeProfile = dikeProfile1 }, Output = new TestGrassCoverErosionInwardsOutput() }; @@ -641,22 +641,22 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = testDikeProfile1 + DikeProfile = dikeProfile1 } }; var subCalculationWithDikeProfile = new GrassCoverErosionInwardsCalculation { InputParameters = { - DikeProfile = testDikeProfile2 + DikeProfile = dikeProfile2 } }; var subCalculationWithOutputHydraulicBoundaryLocationAndDikeProfile = new GrassCoverErosionInwardsCalculation { InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - DikeProfile = testDikeProfile1 + DikeProfile = dikeProfile1 }, Output = new TestGrassCoverErosionInwardsOutput() }; Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs =================================================================== diff -u -raeb6e1a439617630e7613b9ed5af152c345fa2c6 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision aeb6e1a439617630e7613b9ed5af152c345fa2c6) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Utils.Test/GrassCoverErosionInwardsHelperTest.cs (.../GrassCoverErosionInwardsHelperTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -253,15 +253,15 @@ { InputParameters = { - DikeProfile = new TestDikeProfile(new Point2D(1.1, 2.2)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(1.1, 2.2)) } }; private readonly GrassCoverErosionInwardsCalculation calculationInSectionB = new GrassCoverErosionInwardsCalculation { InputParameters = { - DikeProfile = new TestDikeProfile(new Point2D(50.0, 66.0)) + DikeProfile = DikeProfileTestFactory.CreateDikeProfile(new Point2D(50.0, 66.0)) } }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs =================================================================== diff -u -r3178e116f5e59e03078d465efeb303c5e232c7bf -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 3178e116f5e59e03078d465efeb303c5e232c7bf) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DikeProfileTreeNodeInfoTest.cs (.../DikeProfileTreeNodeInfoTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -81,7 +81,7 @@ { // Setup const string profileName = "Random profile name"; - DikeProfile dikeProfile = new TestDikeProfile(profileName); + DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(profileName); // Call string text = info.Text(dikeProfile); Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs =================================================================== diff -u -r1f0cd3fafaa7340a446612870810629587474302 -r8900f570b33f0de1a512fc5b2509771e1201672c --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 1f0cd3fafaa7340a446612870810629587474302) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 8900f570b33f0de1a512fc5b2509771e1201672c) @@ -1329,7 +1329,7 @@ { // Setup GrassCoverErosionInwardsFailureMechanism failureMechanism = null; - DikeProfile profile = new TestDikeProfile(); + DikeProfile profile = DikeProfileTestFactory.CreateDikeProfile(); // Call TestDelegate call = () => RingtoetsDataSynchronizationService.RemoveDikeProfile(failureMechanism, profile);