Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs =================================================================== diff -u -rf31183a0e18731b0b2ef9487c7f7a09713c4c5ef -r6f508b75b217be46357cbf83fca6d488b35c8b51 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision f31183a0e18731b0b2ef9487c7f7a09713c4c5ef) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PropertyClasses/HeightStructuresInputContextPropertiesTest.cs (.../HeightStructuresInputContextPropertiesTest.cs) (revision 6f508b75b217be46357cbf83fca6d488b35c8b51) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Collections.Generic; using System.ComponentModel; using System.Linq; using Application.Ringtoets.Storage.TestUtil; @@ -31,6 +32,7 @@ using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.DikeProfiles; +using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.PropertyClasses; @@ -209,6 +211,38 @@ } [Test] + public void SetStructure_StructureInSection_UpdateSectionResults() + { + // Setup + var assessmentSectionStub = mockRepository.Stub(); + mockRepository.ReplayAll(); + + var failureMechanism = new HeightStructuresFailureMechanism(); + var calculation = new StructuresCalculation(); + var inputContext = new HeightStructuresInputContext(calculation.InputParameters, + calculation, + failureMechanism, + assessmentSectionStub); + var properties = new HeightStructuresInputContextProperties + { + Data = inputContext + }; + + failureMechanism.AddSection(new FailureMechanismSection("Section", new List + { + new Point2D(-10.0, -10.0), + new Point2D(10.0, 10.0) + })); + + // Call + properties.Structure = new TestHeightStructure(); + + // Assert + Assert.AreSame(calculation, failureMechanism.SectionResults.ElementAt(0).Calculation); + mockRepository.VerifyAll(); + } + + [Test] public void PropertyAttributes_ReturnExpectedValues() { // Setup