Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj =================================================================== diff -u -rc9cee4b6d3ce28471a0054fa2bce21ce9e4c60f8 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision c9cee4b6d3ce28471a0054fa2bce21ce9e4c60f8) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Application.Ringtoets.Storage.Test.csproj (.../Application.Ringtoets.Storage.Test.csproj) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -255,10 +255,6 @@ {E344867E-9AC9-44C8-88A5-8185681679A9} Core.Common.IO - - {26214BD0-DAFB-4CFC-8EB2-80C5D53C859E} - Core.Common.Gui.TestUtil - {D749EE4C-CE50-4C17-BF01-9A953028C126} Core.Common.TestUtil Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/IStructureCalculationEntityReadExtensionsTest.cs =================================================================== diff -u -rf2ab39ee883e60b777799905881bb1d0b33d2dca -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/IStructureCalculationEntityReadExtensionsTest.cs (.../IStructureCalculationEntityReadExtensionsTest.cs) (revision f2ab39ee883e60b777799905881bb1d0b33d2dca) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/IStructureCalculationEntityReadExtensionsTest.cs (.../IStructureCalculationEntityReadExtensionsTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -221,13 +221,8 @@ Assert.AreEqual((RoundedDouble) entityValue.ToNullAsNaN(), roundedDouble, roundedDouble.GetAccuracy()); } - private class SimpleStructure : StructureBase + private class SimpleStructuresInput : StructuresInputBase { - public SimpleStructure(ConstructionProperties constructionProperties) : base(constructionProperties) {} - } - - private class SimpleStructuresInput : StructuresInputBase - { public override bool IsStructureInputSynchronized { get Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs =================================================================== diff -u -r922d8c8ebb07e20fb0fe567d65f7d2df2bd224c1 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 922d8c8ebb07e20fb0fe567d65f7d2df2bd224c1) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureBaseTest.cs (.../StructureBaseTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -45,22 +45,22 @@ StructureBase.ConstructionProperties differentId = CreateFullyConfiguredConstructionProperties(); differentId.Id = "differentId"; - yield return new TestCaseData(structure, new TestStructure(differentId), false) + yield return new TestCaseData(structure, new TestStructureBase(differentId), false) .SetName(nameof(differentId)); StructureBase.ConstructionProperties differentName = CreateFullyConfiguredConstructionProperties(); differentName.Name = "differentName"; - yield return new TestCaseData(structure, new TestStructure(differentName), false) + yield return new TestCaseData(structure, new TestStructureBase(differentName), false) .SetName(nameof(differentName)); StructureBase.ConstructionProperties differentLocation = CreateFullyConfiguredConstructionProperties(); differentLocation.Location = new Point2D(9, 9); - yield return new TestCaseData(structure, new TestStructure(differentLocation), false) + yield return new TestCaseData(structure, new TestStructureBase(differentLocation), false) .SetName(nameof(differentLocation)); StructureBase.ConstructionProperties differentOrientation = CreateFullyConfiguredConstructionProperties(); differentOrientation.StructureNormalOrientation = (RoundedDouble) 90; - yield return new TestCaseData(structure, new TestStructure(differentOrientation), false) + yield return new TestCaseData(structure, new TestStructureBase(differentOrientation), false) .SetName(nameof(differentOrientation)); } } @@ -72,7 +72,7 @@ public void Constructor_NameNullOrWhiteSpace_ThrowArgumentException(string name) { // Call - TestDelegate call = () => new TestStructure(new StructureBase.ConstructionProperties + TestDelegate call = () => new TestStructureBase(new StructureBase.ConstructionProperties { Name = name, Id = "anId", @@ -92,7 +92,7 @@ public void Constructor_IdNullOrWhiteSpace_ThrowArgumentException(string id) { // Call - TestDelegate call = () => new TestStructure(new StructureBase.ConstructionProperties + TestDelegate call = () => new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = id, @@ -109,7 +109,7 @@ public void Constructor_LocationNull_ThrowArgumentNullException() { // Call - TestDelegate call = () => new TestStructure(new StructureBase.ConstructionProperties + TestDelegate call = () => new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = "anId", @@ -130,7 +130,7 @@ const double structureNormalOrientation = 0.0; // Call - var structure = new TestStructure(new StructureBase.ConstructionProperties + var structure = new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = "anId", @@ -158,7 +158,7 @@ var location = new Point2D(1.22, 2.333); // Call - var structure = new TestStructure(new StructureBase.ConstructionProperties + var structure = new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = "anId", @@ -179,7 +179,7 @@ public void CopyProperties_FromStructureNull_ThrowsArgumentNullException() { // Setup - var structure = new TestStructure(new StructureBase.ConstructionProperties + var structure = new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = "anId", @@ -198,15 +198,15 @@ public void CopyProperties_FromStructure_UpdatesProperties() { // Setup - var structure = new TestStructure(new StructureBase.ConstructionProperties + var structure = new TestStructureBase(new StructureBase.ConstructionProperties { Name = "aName", Id = "anId", Location = new Point2D(0, 0), StructureNormalOrientation = RoundedDouble.NaN }); - var otherStructure = new TestStructure(new StructureBase.ConstructionProperties + var otherStructure = new TestStructureBase(new StructureBase.ConstructionProperties { Name = "otherName", Id = "otherId", @@ -293,7 +293,7 @@ private static StructureBase CreateFullyDefinedStructure() { - return new TestStructure(CreateFullyConfiguredConstructionProperties()); + return new TestStructureBase(CreateFullyConfiguredConstructionProperties()); } private static StructureBase.ConstructionProperties CreateFullyConfiguredConstructionProperties() @@ -309,13 +309,13 @@ }; } - private class TestStructure : StructureBase + private class TestStructureBase : StructureBase { - public TestStructure(ConstructionProperties constructionProperties) : base(constructionProperties) {} + public TestStructureBase(ConstructionProperties constructionProperties) : base(constructionProperties) {} - public void CopyProperties(TestStructure fromStructure) + public void CopyProperties(TestStructureBase fromStructureBase) { - base.CopyProperties(fromStructure); + base.CopyProperties(fromStructureBase); } } } Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureCollectionTest.cs =================================================================== diff -u -r16a70f4e510b2667a5fcea88d6a34c410d18e168 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureCollectionTest.cs (.../StructureCollectionTest.cs) (revision 16a70f4e510b2667a5fcea88d6a34c410d18e168) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/StructureCollectionTest.cs (.../StructureCollectionTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -32,92 +32,60 @@ [TestFixture] public class StructureCollectionTest : CustomObservableUniqueItemCollectionWithSourcePathTestFixtureBase< - ObservableUniqueItemCollectionWithSourcePath, SimpleStructure> + ObservableUniqueItemCollectionWithSourcePath, TestStructure> { - protected override ObservableUniqueItemCollectionWithSourcePath CreateCollection() + protected override ObservableUniqueItemCollectionWithSourcePath CreateCollection() { - return new StructureCollection(); + return new StructureCollection(); } - protected override IEnumerable UniqueElements() + protected override IEnumerable UniqueElements() { - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = "Structure Id", - Name = "Structure with name", - Location = new Point2D(0, 0) - }); - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = "Other structure Id", - Name = "Structure with name", - Location = new Point2D(0, 0) - }); + yield return new TestStructure("Structure Id"); + yield return new TestStructure("Other structure Id"); } - protected override IEnumerable SingleNonUniqueElements() + protected override IEnumerable SingleNonUniqueElements() { - const string id = "Structure Id"; - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = id, - Name = "Structure name", - Location = new Point2D(0, 0) - }); - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = id, - Name = "Other structure name", - Location = new Point2D(1, 1) - }); + yield return new TestStructure("Structure Id"); + yield return new TestStructure("Structure Id", + "Other structure name", + new Point2D(1, 1)); } - protected override IEnumerable MultipleNonUniqueElements() + protected override IEnumerable MultipleNonUniqueElements() { const string id = "Structure Id"; const string otherId = "Other structure Id"; - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = id, - Name = "Structure name A", - Location = new Point2D(1, 0) - }); - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = id, - Name = "Structure name B", - Location = new Point2D(2, 0) - }); - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = otherId, - Name = "Structure name C", - Location = new Point2D(3, 0) - }); - yield return new SimpleStructure(new StructureBase.ConstructionProperties - { - Id = otherId, - Name = "Structure name D", - Location = new Point2D(4, 0) - }); + yield return new TestStructure(id, + "Structure name A", + new Point2D(1, 0)); + yield return new TestStructure(id, + "Structure name B", + new Point2D(2, 0)); + yield return new TestStructure(otherId, + "Structure name C", + new Point2D(3, 0)); + yield return new TestStructure(otherId, + "Structure name D", + new Point2D(4, 0)); } - protected override void AssertSingleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) + protected override void AssertSingleNonUniqueElements(ArgumentException exception, + IEnumerable itemsToAdd) { string someId = itemsToAdd.First().Id; - Assert.AreEqual($"Kunstwerken moeten een unieke id hebben. Gevonden dubbele elementen: {someId}.", exception.Message); + Assert.AreEqual($"Kunstwerken moeten een unieke id hebben. Gevonden dubbele elementen: {someId}.", + exception.Message); } - protected override void AssertMultipleNonUniqueElements(ArgumentException exception, IEnumerable itemsToAdd) + protected override void AssertMultipleNonUniqueElements(ArgumentException exception, + IEnumerable itemsToAdd) { string someId = itemsToAdd.First().Id; string someOtherId = itemsToAdd.First(i => i.Id != someId).Id; - Assert.AreEqual($"Kunstwerken moeten een unieke id hebben. Gevonden dubbele elementen: {someId}, {someOtherId}.", exception.Message); + Assert.AreEqual($"Kunstwerken moeten een unieke id hebben. Gevonden dubbele elementen: {someId}, {someOtherId}.", + exception.Message); } } - - public class SimpleStructure : StructureBase - { - public SimpleStructure(ConstructionProperties constructionProperties) : base(constructionProperties) {} - } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresInputBaseTest.cs =================================================================== diff -u -rf411570487c2c859af89b0cefd544386a6a60c15 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresInputBaseTest.cs (.../StructuresInputBaseTest.cs) (revision f411570487c2c859af89b0cefd544386a6a60c15) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Structures/StructuresInputBaseTest.cs (.../StructuresInputBaseTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -122,13 +122,7 @@ public void Structure_Always_ExpectedValues() { // Setup - var structure = new SimpleStructure(new StructureBase.ConstructionProperties - { - Name = "", - Location = new Point2D(0, 0), - Id = "id" - }); - + var structure = new TestStructure(); var input = new SimpleStructuresInput(); // Precondition @@ -148,12 +142,7 @@ // Setup var input = new SimpleStructuresInput { - Structure = new SimpleStructure(new StructureBase.ConstructionProperties - { - Name = "", - Location = new Point2D(0, 0), - Id = "id" - }) + Structure = new TestStructure() }; // Call @@ -167,13 +156,7 @@ public void GivenInputWithStructure_WhenStructureNull_ThenSchematizationPropertiesSynedToDefaults() { // Given - var structure = new SimpleStructure(new StructureBase.ConstructionProperties - { - Name = "", - Location = new Point2D(0, 0), - Id = "id" - }); - + var structure = new TestStructure(); var input = new SimpleStructuresInput { Structure = structure, @@ -312,11 +295,6 @@ } } - private class SimpleStructure : StructureBase - { - public SimpleStructure(ConstructionProperties constructionProperties) : base(constructionProperties) {} - } - #region Schematization [Test] Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs =================================================================== diff -u -rd32eef17c3a48ff9b0cfce71088e912b1b5bb8c0 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs (.../TestStructureTest.cs) (revision d32eef17c3a48ff9b0cfce71088e912b1b5bb8c0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil.Test/TestStructureTest.cs (.../TestStructureTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -34,14 +34,67 @@ var structure = new TestStructure(); // Assert - Assert.AreEqual("name", structure.Name); Assert.AreEqual("id", structure.Id); + Assert.AreEqual("name", structure.Name); Assert.AreEqual(new Point2D(0.0, 0.0), structure.Location); Assert.AreEqual(0.12345, structure.StructureNormalOrientation, structure.StructureNormalOrientation.GetAccuracy()); } [Test] + public void IdConstructor_ExpectedProperties() + { + // Setup + const string id = "some Id"; + + // Call + var structure = new TestStructure(id); + + // Assert + Assert.AreEqual(id, structure.Id); + Assert.AreEqual("name", structure.Name); + Assert.AreEqual(new Point2D(0.0, 0.0), structure.Location); + Assert.AreEqual(0.12345, structure.StructureNormalOrientation, + structure.StructureNormalOrientation.GetAccuracy()); + } + + [Test] + public void IdNameConstructor_ExpectedProperties() + { + // Setup + const string id = "some Id"; + const string name = "some name"; + + // Call + var structure = new TestStructure(id, name); + + // Assert + Assert.AreEqual(id, structure.Id); + Assert.AreEqual(name, structure.Name); + Assert.AreEqual(new Point2D(0.0, 0.0), structure.Location); + Assert.AreEqual(0.12345, structure.StructureNormalOrientation, + structure.StructureNormalOrientation.GetAccuracy()); + } + + [Test] + public void IdLocationConstructor_ExpectedProperties() + { + // Setup + const string id = "some Id"; + var location = new Point2D(1, 1); + + // Call + var structure = new TestStructure(id, location); + + // Assert + Assert.AreEqual(id, structure.Id); + Assert.AreEqual("name", structure.Name); + Assert.AreSame(location, structure.Location); + Assert.AreEqual(0.12345, structure.StructureNormalOrientation, + structure.StructureNormalOrientation.GetAccuracy()); + } + + [Test] public void Point2DConstructor_ExpectedProperties() { // Setup @@ -51,11 +104,30 @@ var structure = new TestStructure(location); // Assert - Assert.AreEqual("name", structure.Name); Assert.AreEqual("id", structure.Id); - Assert.AreEqual(location, structure.Location); + Assert.AreEqual("name", structure.Name); + Assert.AreSame(location, structure.Location); Assert.AreEqual(0.12345, structure.StructureNormalOrientation, structure.StructureNormalOrientation.GetAccuracy()); } + + [Test] + public void IdNamePoint2DConstructor_ExpectedProperties() + { + // Setup + const string id = "some Id"; + const string name = "some name"; + var location = new Point2D(1, 1); + + // Call + var structure = new TestStructure(id, name, location); + + // Assert + Assert.AreEqual(id, structure.Id); + Assert.AreEqual(name, structure.Name); + Assert.AreSame(location, structure.Location); + Assert.AreEqual(0.12345, structure.StructureNormalOrientation, + structure.StructureNormalOrientation.GetAccuracy()); + } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs =================================================================== diff -u -rd32eef17c3a48ff9b0cfce71088e912b1b5bb8c0 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs (.../TestStructure.cs) (revision d32eef17c3a48ff9b0cfce71088e912b1b5bb8c0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.TestUtil/TestStructure.cs (.../TestStructure.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -33,17 +33,60 @@ /// /// Creates a new instance of . /// - public TestStructure() : this("name", "id", new Point2D(0.0, 0.0)) {} + public TestStructure() + : this("id") {} /// /// Creates a new instance of . /// + /// The id of the structure. + /// Thrown when + /// is null, empty or consists of whitespace. + public TestStructure(string id) + : this(id, "name") {} + + /// + /// Creates a new instance of . + /// + /// The id of the structure. + /// The name of the structure. + /// Thrown when or + /// is null, empty or consists of only whitespaces. + public TestStructure(string id, string name) + : this(id, name, new Point2D(0.0, 0.0)) { } + + /// + /// Creates a new instance of . + /// + /// The id of the structure. /// The location of the structure. + /// Thrown when is + /// null, empty or consists of only whitespaces. /// Thrown when /// is null. - public TestStructure(Point2D location) : this("name", "id", location) {} + public TestStructure(string id, Point2D location) + : this(id, "name", location) { } - private TestStructure(string name, string id, Point2D location) + /// + /// Creates a new instance of . + /// + /// The location of the structure. + /// Thrown when + /// is null. + public TestStructure(Point2D location) + : this("id", "name", location) {} + + /// + /// Creates a new instance of . + /// + /// The id of the structure. + /// The name of the structure. + /// The location of the structure. + /// Thrown when or + /// is null, empty or consists of only whitespaces. + /// Thrown when + /// is null. + public TestStructure(string id, string name, Point2D location) : base(new ConstructionProperties { Name = name, Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs =================================================================== diff -u -r89bea52ae1b4639721b93bdd4a537f36ec6d6b9c -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision 89bea52ae1b4639721b93bdd4a537f36ec6d6b9c) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Factories/RingtoetsMapDataFeaturesFactoryTest.cs (.../RingtoetsMapDataFeaturesFactoryTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -431,8 +431,8 @@ public void CreateStructuresFeatures_WithStructures_ReturnsCollectionWithFeatures() { // Setup - var structure1 = new SimpleStructure(new Point2D(1.1, 2.2), "A"); - var structure2 = new SimpleStructure(new Point2D(3.3, 4.4), "B"); + var structure1 = new TestStructure("id", "A", new Point2D(1.1, 2.2)); + var structure2 = new TestStructure("id", "B", new Point2D(3.3, 4.4)); var structures = new[] { @@ -498,7 +498,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocationA, - Structure = new SimpleStructure(calculationLocationA) + Structure = new TestStructure(calculationLocationA) } }; @@ -507,7 +507,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocationB, - Structure = new SimpleStructure(calculationLocationB) + Structure = new TestStructure(calculationLocationB) } }; @@ -858,16 +858,5 @@ } private class SimpleStructuresCalculation : StructuresCalculation {} - - private class SimpleStructure : StructureBase - { - public SimpleStructure(Point2D location, string name = "name") - : base(new ConstructionProperties - { - Location = location, - Name = name, - Id = "id" - }) {} - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs =================================================================== diff -u -r89bea52ae1b4639721b93bdd4a537f36ec6d6b9c -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision 89bea52ae1b4639721b93bdd4a537f36ec6d6b9c) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/StructuresInputBasePropertiesTest.cs (.../StructuresInputBasePropertiesTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -31,7 +31,6 @@ using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; using Ringtoets.Common.Data.FailureMechanism; @@ -91,10 +90,10 @@ mockRepository.ReplayAll(); StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties constructionProperties = GetRandomConstructionProperties(); // Call @@ -111,10 +110,10 @@ { // Setup StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties constructionProperties = GetRandomConstructionProperties(); var calculation = new StructuresCalculation(); var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -137,10 +136,10 @@ mockRepository.ReplayAll(); StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties constructionProperties = GetRandomConstructionProperties(); var calculation = new StructuresCalculation(); var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -157,7 +156,7 @@ // Assert Assert.IsInstanceOf, IFailureMechanism>>>(properties); Assert.IsInstanceOf(properties); - Assert.IsInstanceOf>(properties); + Assert.IsInstanceOf>(properties); Assert.IsInstanceOf(properties); Assert.AreSame(inputContext, properties.Data); @@ -291,10 +290,10 @@ mockRepository.ReplayAll(); StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties constructionProperties = GetRandomConstructionProperties(); var calculation = new StructuresCalculation(); var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -304,7 +303,7 @@ if (hasStructure) { - calculation.InputParameters.Structure = new SimpleStructure(); + calculation.InputParameters.Structure = new TestStructure(); } // Call @@ -342,10 +341,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -379,7 +378,7 @@ { InputParameters = { - Structure = new SimpleStructure(new Point2D(200620.173572981, 503401.652985217)) + Structure = new TestStructure(new Point2D(200620.173572981, 503401.652985217)) } }; var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -390,10 +389,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -428,7 +427,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - Structure = new SimpleStructure(new Point2D(200620.173572981, 503401.652985217)) + Structure = new TestStructure(new Point2D(200620.173572981, 503401.652985217)) } }; var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -439,10 +438,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -483,7 +482,7 @@ InputParameters = { HydraulicBoundaryLocation = hydraulicBoundaryLocation, - Structure = new SimpleStructure(new Point2D(200620.173572981, 503401.652985217)) + Structure = new TestStructure(new Point2D(200620.173572981, 503401.652985217)) } }; var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -494,10 +493,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -540,10 +539,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -583,7 +582,7 @@ { InputParameters = { - Structure = new SimpleStructure() + Structure = new TestStructure() } }; var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -593,10 +592,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), handler); @@ -639,26 +638,26 @@ { InputParameters = { - Structure = new SimpleStructure() + Structure = new TestStructure() } }; var inputContext = new SimpleInputContext(calculation.InputParameters, calculation, failureMechanism, assessmentSection); - var newStructure = new SimpleStructure(new Point2D(0, 190)); + var newStructure = new TestStructure(new Point2D(0, 190)); CalculationInputSetPropertyValueAfterConfirmationParameterTester customHandler = CreateCustomHandlerForCalculationReturningNoObservables(); var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -699,7 +698,7 @@ { InputParameters = { - Structure = new SimpleStructure() + Structure = new TestStructure() } }; var inputContext = new SimpleInputContext(calculation.InputParameters, @@ -710,18 +709,18 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), new ObservablePropertyChangeHandler(inputContext.Calculation, calculation.InputParameters)); inputContext.Attach(observerMock); var random = new Random(100); double newStructureNormalOrientation = random.NextDouble(); - var newStructure = new SimpleStructure(); + var newStructure = new TestStructure(); ForeshoreProfile newForeshoreProfile = new TestForeshoreProfile(); HydraulicBoundaryLocation newHydraulicBoundaryLocation = CreateHydraulicBoundaryLocation(); var newSelectableHydraulicBoundaryLocation = new SelectableHydraulicBoundaryLocation(newHydraulicBoundaryLocation, null); @@ -746,7 +745,7 @@ [Test] public void Structure_Always_InputChangedAndObservablesNotified() { - var structure = new SimpleStructure(); + var structure = new TestStructure(); SetPropertyAndVerifyNotifcationsAndOutput( properties => properties.Structure = structure); } @@ -873,10 +872,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -902,17 +901,17 @@ failureMechanism, assessmentSection); - var newStructure = new SimpleStructure(); + var newStructure = new TestStructure(); CalculationInputSetPropertyValueAfterConfirmationParameterTester customHandler = CreateCustomHandlerForCalculationReturningNoObservables(); var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -947,10 +946,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -984,10 +983,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -1019,10 +1018,10 @@ var properties = new SimpleStructuresInputProperties( inputContext, new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties(), customHandler); @@ -1042,10 +1041,10 @@ } private static StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties GetRandomConstructionProperties() { @@ -1087,50 +1086,37 @@ .ToList(); return new StructuresInputBaseProperties< - SimpleStructure, - SimpleStructureInput, - StructuresCalculation, - IFailureMechanism> + TestStructure, + SimpleStructureInput, + StructuresCalculation, + IFailureMechanism> .ConstructionProperties - { - StructurePropertyIndex = randomObjectLookup.IndexOf(structureObject), - StructureLocationPropertyIndex = randomObjectLookup.IndexOf(structureLocationObject), - StructureNormalOrientationPropertyIndex = randomObjectLookup.IndexOf(structureNormalOrientationObject), - FlowWidthAtBottomProtectionPropertyIndex = randomObjectLookup.IndexOf(flowWidthAtBottomProtectionObject), - WidthFlowAperturesPropertyIndex = randomObjectLookup.IndexOf(widthFlowAperturesObject), - StorageStructureAreaPropertyIndex = randomObjectLookup.IndexOf(storageStructureAreaObject), - AllowedLevelIncreaseStoragePropertyIndex = randomObjectLookup.IndexOf(allowedLevelIncreaseStorageObject), - CriticalOvertoppingDischargePropertyIndex = randomObjectLookup.IndexOf(criticalOvertoppingDischargeObject), - FailureProbabilityStructureWithErosionPropertyIndex = randomObjectLookup.IndexOf(failureProbabilityStructureWithErosionObject), - ForeshoreProfilePropertyIndex = randomObjectLookup.IndexOf(foreshoreProfileObject), - UseBreakWaterPropertyIndex = randomObjectLookup.IndexOf(useBreakWaterObject), - UseForeshorePropertyIndex = randomObjectLookup.IndexOf(useForeshoreObject), - ModelFactorSuperCriticalFlowPropertyIndex = randomObjectLookup.IndexOf(modelFactorSuperCriticalFlowObject), - HydraulicBoundaryLocationPropertyIndex = randomObjectLookup.IndexOf(hydraulicBoundaryLocationObject), - StormDurationPropertyIndex = randomObjectLookup.IndexOf(stormDurationObject) - }; + { + StructurePropertyIndex = randomObjectLookup.IndexOf(structureObject), + StructureLocationPropertyIndex = randomObjectLookup.IndexOf(structureLocationObject), + StructureNormalOrientationPropertyIndex = randomObjectLookup.IndexOf(structureNormalOrientationObject), + FlowWidthAtBottomProtectionPropertyIndex = randomObjectLookup.IndexOf(flowWidthAtBottomProtectionObject), + WidthFlowAperturesPropertyIndex = randomObjectLookup.IndexOf(widthFlowAperturesObject), + StorageStructureAreaPropertyIndex = randomObjectLookup.IndexOf(storageStructureAreaObject), + AllowedLevelIncreaseStoragePropertyIndex = randomObjectLookup.IndexOf(allowedLevelIncreaseStorageObject), + CriticalOvertoppingDischargePropertyIndex = randomObjectLookup.IndexOf(criticalOvertoppingDischargeObject), + FailureProbabilityStructureWithErosionPropertyIndex = randomObjectLookup.IndexOf(failureProbabilityStructureWithErosionObject), + ForeshoreProfilePropertyIndex = randomObjectLookup.IndexOf(foreshoreProfileObject), + UseBreakWaterPropertyIndex = randomObjectLookup.IndexOf(useBreakWaterObject), + UseForeshorePropertyIndex = randomObjectLookup.IndexOf(useForeshoreObject), + ModelFactorSuperCriticalFlowPropertyIndex = randomObjectLookup.IndexOf(modelFactorSuperCriticalFlowObject), + HydraulicBoundaryLocationPropertyIndex = randomObjectLookup.IndexOf(hydraulicBoundaryLocationObject), + StormDurationPropertyIndex = randomObjectLookup.IndexOf(stormDurationObject) + }; } private static HydraulicBoundaryLocation CreateHydraulicBoundaryLocation() { return new HydraulicBoundaryLocation(0, "", 0, 0); } - private class SimpleStructure : StructureBase + private class SimpleStructureInput : StructuresInputBase { - public SimpleStructure() : this(new Point2D(0, 0)) {} - - public SimpleStructure(Point2D location) : base(new ConstructionProperties - { - Name = "Name", - Id = "Id", - Location = location, - StructureNormalOrientation = (RoundedDouble) 0 - }) {} - } - - private class SimpleStructureInput : StructuresInputBase - { public override bool IsStructureInputSynchronized { get @@ -1143,7 +1129,7 @@ } private class SimpleStructuresInputProperties : StructuresInputBaseProperties< - SimpleStructure, + TestStructure, SimpleStructureInput, StructuresCalculation, IFailureMechanism> @@ -1162,9 +1148,9 @@ yield return new TestForeshoreProfile(); } - public override IEnumerable GetAvailableStructures() + public override IEnumerable GetAvailableStructures() { - yield return new SimpleStructure(); + yield return new TestStructure(); } protected override void AfterSettingStructure() @@ -1194,7 +1180,7 @@ var calculation = new StructuresCalculation(); SimpleStructureInput input = calculation.InputParameters; input.ForeshoreProfile = new TestForeshoreProfile(); - input.Structure = new SimpleStructure(); + input.Structure = new TestStructure(); var customHandler = new CalculationInputSetPropertyValueAfterConfirmationParameterTester(new[] { Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs (.../StructureSelectionDialogTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/StructureSelectionDialogTest.cs (.../StructureSelectionDialogTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -22,12 +22,11 @@ using System; using System.Linq; using System.Windows.Forms; -using Core.Common.Base.Data; -using Core.Common.Base.Geometry; using Core.Common.Controls.DataGrid; using NUnit.Extensions.Forms; using NUnit.Framework; using Ringtoets.Common.Data; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.Common.Forms.Test { @@ -113,36 +112,25 @@ { // Setup const string testname = "Test"; - var constructionProperties = new StructureBase.ConstructionProperties - { - Name = testname, - Id = "anId", - Location = new Point2D(0, 0), - StructureNormalOrientation = (RoundedDouble) 0.0 - }; - var structure = new TestStructure(constructionProperties); + var structure = new TestStructure("id", testname); using (var viewParent = new Form()) - - // Call - using (var dialog = new StructureSelectionDialog(viewParent, new[] { - structure - })) - { - // Assert - dialog.Show(); + // Call + using (var dialog = new StructureSelectionDialog(viewParent, new[] + { + structure + })) + { + // Assert + dialog.Show(); - var dataGridViewControl = (DataGridViewControl) new ControlTester("DataGridViewControl").TheObject; - Assert.AreEqual(1, dataGridViewControl.Rows.Count); - Assert.IsFalse((bool) dataGridViewControl.Rows[0].Cells[selectItemColumnIndex].Value); - Assert.AreEqual(testname, (string) dataGridViewControl.Rows[0].Cells[nameColumnIndex].Value); + var dataGridViewControl = (DataGridViewControl) new ControlTester("DataGridViewControl").TheObject; + Assert.AreEqual(1, dataGridViewControl.Rows.Count); + Assert.IsFalse((bool) dataGridViewControl.Rows[0].Cells[selectItemColumnIndex].Value); + Assert.AreEqual(testname, (string) dataGridViewControl.Rows[0].Cells[nameColumnIndex].Value); + } } } - - private class TestStructure : StructureBase - { - public TestStructure(ConstructionProperties constructionProperties) : base(constructionProperties) {} - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs =================================================================== diff -u -rb3b6c13cf736c134476b3db34281332d01ca86b1 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs (.../StructureEditorTest.cs) (revision b3b6c13cf736c134476b3db34281332d01ca86b1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/UITypeEditors/StructureEditorTest.cs (.../StructureEditorTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -23,13 +23,11 @@ using System.Collections.Generic; using System.ComponentModel; using System.Windows.Forms.Design; -using Core.Common.Base.Data; -using Core.Common.Base.Geometry; using Core.Common.Gui.PropertyBag; using Core.Common.Gui.UITypeEditors; using NUnit.Framework; using Rhino.Mocks; -using Ringtoets.Common.Data; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.UITypeEditors; namespace Ringtoets.Common.Forms.Test.UITypeEditors @@ -49,20 +47,20 @@ public void DefaultConstructor_ReturnsNewInstance() { // Call - var editor = new StructureEditor(); + var editor = new StructureEditor(); // Assert - Assert.IsInstanceOf, SimpleStructure>>(editor); + Assert.IsInstanceOf, TestStructure>>(editor); } [Test] public void EditValue_WithCurrentItemNotInAvailableItems_ReturnsOriginalValue() { // Setup - var simpleStructure = new SimpleStructure(); - var properties = new ObjectPropertiesWithStructure(simpleStructure, new SimpleStructure[0]); + var simpleStructure = new TestStructure(); + var properties = new ObjectPropertiesWithStructure(simpleStructure, new TestStructure[0]); var propertyBag = new DynamicPropertyBag(properties); - var editor = new StructureEditor(); + var editor = new StructureEditor(); var someValue = new object(); var serviceProviderStub = mockRepository.Stub(); var serviceStub = mockRepository.Stub(); @@ -83,13 +81,13 @@ public void EditValue_WithCurrentItemInAvailableItems_ReturnsCurrentItem() { // Setup - var simpleStructure = new SimpleStructure(); + var simpleStructure = new TestStructure(); var properties = new ObjectPropertiesWithStructure(simpleStructure, new[] { simpleStructure }); var propertyBag = new DynamicPropertyBag(properties); - var editor = new StructureEditor(); + var editor = new StructureEditor(); var someValue = new object(); var serviceProviderStub = mockRepository.Stub(); var serviceStub = mockRepository.Stub(); @@ -106,32 +104,21 @@ mockRepository.VerifyAll(); } - private class SimpleStructure : StructureBase + private class ObjectPropertiesWithStructure : IHasStructureProperty { - public SimpleStructure() : base(new ConstructionProperties - { - Name = "Name", - Id = "Id", - Location = new Point2D(0, 0), - StructureNormalOrientation = (RoundedDouble) 0 - }) {} - } + private readonly IEnumerable availableStructures; - private class ObjectPropertiesWithStructure : IHasStructureProperty - { - private readonly IEnumerable availableStructures; - - public ObjectPropertiesWithStructure(SimpleStructure structure, IEnumerable availableStructures) + public ObjectPropertiesWithStructure(TestStructure structure, IEnumerable availableStructures) { Structure = structure; this.availableStructures = availableStructures; } public object Data { get; set; } - public SimpleStructure Structure { get; } + public TestStructure Structure { get; } - public IEnumerable GetAvailableStructures() + public IEnumerable GetAvailableStructures() { return availableStructures; } Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs =================================================================== diff -u -r022a409926423d8107a307e28e3a13a8f2a83188 -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision 022a409926423d8107a307e28e3a13a8f2a83188) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/Configurations/Import/CalculationConfigurationImporterTest.cs (.../CalculationConfigurationImporterTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -26,7 +26,6 @@ using System.Xml.Linq; using Core.Common.Base; using Core.Common.Base.Data; -using Core.Common.Base.Geometry; using Core.Common.Base.IO; using Core.Common.TestUtil; using NUnit.Framework; @@ -678,7 +677,7 @@ public void TryReadStructure_WithStructureToFindStructuresContainsStructure_ReturnsTrue() { // Setup - const string structureName = "someName"; + const string structureId = "someId"; const string calculationName = "name"; string filePath = Path.Combine(readerPath, "validConfiguration.xml"); @@ -688,17 +687,17 @@ var importer = new CalculationConfigurationImporter(filePath, calculationGroup); - var expectedProfile = new TestStructure(structureName); + var expectedProfile = new TestStructure(structureId); StructureBase structure; // Call - bool valid = importer.PublicTryReadStructure(structureName, + bool valid = importer.PublicTryReadStructure(structureId, calculationName, new[] { - new TestStructure("otherNameA"), + new TestStructure("otherIdA"), expectedProfile, - new TestStructure("otherNameB") + new TestStructure("otherIdB") }, out structure); @@ -865,17 +864,6 @@ } } - private class TestStructure : StructureBase - { - public TestStructure(string Id) : base(new ConstructionProperties - { - Name = "Name", - Id = Id, - Location = new Point2D(0, 0), - StructureNormalOrientation = (RoundedDouble) 2 - }) {} - } - private class TestInputWithForeshoreProfileAndBreakWater : Observable, IUseBreakWater, IUseForeshore { public TestInputWithForeshoreProfileAndBreakWater(BreakWater breakWater) Index: Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs =================================================================== diff -u -r89bea52ae1b4639721b93bdd4a537f36ec6d6b9c -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs (.../RingtoetsCommonDataSynchronizationServiceTest.cs) (revision 89bea52ae1b4639721b93bdd4a537f36ec6d6b9c) +++ Ringtoets/Common/test/Ringtoets.Common.Service.Test/RingtoetsCommonDataSynchronizationServiceTest.cs (.../RingtoetsCommonDataSynchronizationServiceTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Core.Common.Base; using Core.Common.Base.Geometry; using NUnit.Framework; @@ -32,7 +33,6 @@ using Ringtoets.Common.Data.Probability; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; -using Enumerable = System.Linq.Enumerable; namespace Ringtoets.Common.Service.Test { @@ -240,7 +240,7 @@ { // Call TestDelegate test = () => RingtoetsCommonDataSynchronizationService.RemoveStructure( - new TestStructure("id", new Point2D(0,0)), + new TestStructure(new Point2D(0, 0)), null, new StructureCollection(), Enumerable.Empty()); @@ -255,7 +255,7 @@ { // Call TestDelegate test = () => RingtoetsCommonDataSynchronizationService.RemoveStructure( - new TestStructure("id", new Point2D(0, 0)), + new TestStructure(new Point2D(0, 0)), Enumerable.Empty>(), null, Enumerable.Empty()); @@ -270,7 +270,7 @@ { // Call TestDelegate test = () => RingtoetsCommonDataSynchronizationService.RemoveStructure( - new TestStructure("id", new Point2D(0, 0)), + new TestStructure(new Point2D(0, 0)), Enumerable.Empty>(), new StructureCollection(), null); @@ -535,15 +535,5 @@ public override void SynchronizeStructureInput() {} } - - private class TestStructure : StructureBase - { - public TestStructure(string id, Point2D location) : base(new ConstructionProperties - { - Name = $"{id} name", - Id = id, - Location = location - }) {} - } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs =================================================================== diff -u -r89bea52ae1b4639721b93bdd4a537f36ec6d6b9c -r9ff0a37a156186137dbaf5a4d43bc0fab10de1f0 --- Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs (.../StructuresHelperTest.cs) (revision 89bea52ae1b4639721b93bdd4a537f36ec6d6b9c) +++ Ringtoets/Common/test/Ringtoets.Common.Utils.Test/StructuresHelperTest.cs (.../StructuresHelperTest.cs) (revision 9ff0a37a156186137dbaf5a4d43bc0fab10de1f0) @@ -22,13 +22,13 @@ using System; using System.Collections.Generic; using System.Linq; -using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Structures; +using Ringtoets.Common.Data.TestUtil; namespace Ringtoets.Common.Utils.Test { @@ -257,11 +257,6 @@ private static readonly TestStructuresFailureMechanismSectionResult sectionResult = new TestStructuresFailureMechanismSectionResult( failureMechanismSectionA); - private readonly FailureMechanismSection[] oneSection = - { - failureMechanismSectionA - }; - private readonly FailureMechanismSection[] twoSections = { failureMechanismSectionA, @@ -272,29 +267,18 @@ { InputParameters = { - Structure = new TestStructure("aName", "anId", new Point2D(1.1, 2.2), 0.0) + Structure = new TestStructure("anId", "aName", new Point2D(1.1, 2.2)) } }; private readonly StructuresCalculation calculationInSectionB = new StructuresCalculation { InputParameters = { - Structure = new TestStructure("aName", "anId", new Point2D(50.0, 66.0), 0.0) + Structure = new TestStructure("anId", "aName", new Point2D(50.0, 66.0)) } }; - private class TestStructure : StructureBase - { - public TestStructure(string name, string id, Point2D location, double normal) : base(new ConstructionProperties - { - Name = name, - Id = id, - Location = location, - StructureNormalOrientation = (RoundedDouble) normal - }) {} - } - #endregion } } \ No newline at end of file