Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs =================================================================== diff -u -ra95d1154c11d36bd230bcb7599872963f331ee15 -rbf3379d1adf449816e6fe5f941604ce2e6d0b707 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision a95d1154c11d36bd230bcb7599872963f331ee15) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Data.Test/HeightStructuresInputTest.cs (.../HeightStructuresInputTest.cs) (revision bf3379d1adf449816e6fe5f941604ce2e6d0b707) @@ -21,6 +21,7 @@ using System; using Core.Common.Base.Data; +using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Probabilistics; @@ -63,7 +64,7 @@ input.Structure = null; // Assert - AssertHeightStructure(null, input); + AssertHeightStructureInput(null, input); } [Test] @@ -79,7 +80,7 @@ RoundedDouble expectedDeviationWaveDirection = input.DeviationWaveDirection; // Pre-condition - AssertHeightStructure(structure, input); + AssertHeightStructureInput(structure, input); // When input.Structure = null; @@ -108,7 +109,7 @@ input.Structure = structure; // Assert - AssertHeightStructure(structure, input); + AssertHeightStructureInput(structure, input); } [Test] @@ -167,6 +168,47 @@ Assert.IsFalse(isStructureInputSynchronized); } + [Test] + public void SynchronizeStructureInput_StructureNotSet_ExpectedValues() + { + // Setup + var input = new HeightStructuresInput(); + + // Call + input.SynchronizeStructureInput(); + + // Assert + AssertHeightStructureInput(null, input); + } + + [Test] + public void SynchronizeStructureInput_ChangedStructure_ExpectedValues() + { + // Setup + var differentStructure = new HeightStructure(new HeightStructure.ConstructionProperties + { + Id = "Test id", + Name = "Test name", + Location = new Point2D(-1, -1) + }); + + var input = new HeightStructuresInput + { + Structure = new TestHeightStructure() + }; + + input.Structure.CopyProperties(differentStructure); + + // Precondition + AssertHeightStructureInput(new TestHeightStructure(), input); + + // Call + input.SynchronizeStructureInput(); + + // Assert + AssertHeightStructureInput(differentStructure, input); + } + #region Schematization [Test] @@ -244,7 +286,7 @@ #region Helpers - private static void AssertHeightStructure(HeightStructure expectedHeightStructure, HeightStructuresInput input) + private static void AssertHeightStructureInput(HeightStructure expectedHeightStructure, HeightStructuresInput input) { if (expectedHeightStructure == null) {