Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs =================================================================== diff -u -r4bf59bb3506b840b284efe0c0f4431b7876e0e5b -rc1594afa56f02899bd122fc4fd4ccf4d76b236b7 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs (.../HeightStructuresDataSynchronizationServiceTest.cs) (revision 4bf59bb3506b840b284efe0c0f4431b7876e0e5b) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Service.Test/HeightStructuresDataSynchronizationServiceTest.cs (.../HeightStructuresDataSynchronizationServiceTest.cs) (revision c1594afa56f02899bd122fc4fd4ccf4d76b236b7) @@ -282,7 +282,7 @@ .Concat(failureMechanism.SectionResults) .Concat(failureMechanism.CalculationsGroup.GetAllChildrenRecursive()) .Concat(failureMechanism.ForeshoreProfiles) - .Concat(failureMechanism.HeightStructures) + .Concat(failureMechanism.HeightStructuresCollection) .ToArray(); // Call @@ -295,14 +295,14 @@ CollectionAssert.IsEmpty(failureMechanism.SectionResults); CollectionAssert.IsEmpty(failureMechanism.CalculationsGroup.Children); CollectionAssert.IsEmpty(failureMechanism.ForeshoreProfiles); - CollectionAssert.IsEmpty(failureMechanism.HeightStructures); + CollectionAssert.IsEmpty(failureMechanism.HeightStructuresCollection); IObservable[] array = results.ChangedObjects.ToArray(); Assert.AreEqual(4, array.Length); CollectionAssert.Contains(array, failureMechanism); CollectionAssert.Contains(array, failureMechanism.CalculationsGroup); CollectionAssert.Contains(array, failureMechanism.ForeshoreProfiles); - CollectionAssert.Contains(array, failureMechanism.HeightStructures); + CollectionAssert.Contains(array, failureMechanism.HeightStructuresCollection); CollectionAssert.AreEquivalent(expectedRemovedObjects, results.RemovedObjects); } @@ -312,7 +312,7 @@ { // Setup HeightStructuresFailureMechanism failureMechanism = CreateFullyConfiguredFailureMechanism(); - HeightStructure structure = failureMechanism.HeightStructures[0]; + HeightStructure structure = failureMechanism.HeightStructuresCollection[0]; StructuresCalculation[] calculationsWithStructure = failureMechanism.Calculations .Cast>() .Where(c => ReferenceEquals(c.InputParameters.Structure, structure)) @@ -339,7 +339,7 @@ // Assert // Note: To make sure the clear is performed regardless of what is done with // the return result, no ToArray() should be called before these assertions: - CollectionAssert.DoesNotContain(failureMechanism.HeightStructures, structure); + CollectionAssert.DoesNotContain(failureMechanism.HeightStructuresCollection, structure); foreach (StructuresCalculation calculation in calculationsWithStructure) { Assert.IsNull(calculation.InputParameters.Structure); @@ -356,7 +356,7 @@ IObservable[] array = affectedObjects.ToArray(); Assert.AreEqual(1 + calculationsWithOutput.Length + calculationsWithStructure.Length + sectionResultsWithStructure.Length, array.Length); - CollectionAssert.Contains(array, failureMechanism.HeightStructures); + CollectionAssert.Contains(array, failureMechanism.HeightStructuresCollection); foreach (StructuresCalculation calculation in calculationsWithStructure) { CollectionAssert.Contains(array, calculation.InputParameters); @@ -385,8 +385,8 @@ new Point2D(2, 0), new Point2D(4, 0) }); - var structure1 = new TestHeightStructure(new Point2D(1, 0)); - var structure2 = new TestHeightStructure(new Point2D(3, 0)); + var structure1 = new TestHeightStructure(new Point2D(1, 0), "Id 1,0"); + var structure2 = new TestHeightStructure(new Point2D(3, 0), "Id 3,0"); var profile = new TestForeshoreProfile(); StructuresCalculation calculation1 = new TestHeightStructuresCalculation { @@ -415,11 +415,6 @@ }; var failureMechanism = new HeightStructuresFailureMechanism { - HeightStructures = - { - structure1, - structure2 - }, ForeshoreProfiles = { profile @@ -441,6 +436,12 @@ } }; + failureMechanism.HeightStructuresCollection.AddRange(new[] + { + structure1, + structure2 + }, "someLocation"); + failureMechanism.AddSection(section1); failureMechanism.AddSection(section2); HeightStructuresFailureMechanismSectionResult result1 = failureMechanism.SectionResults