Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs =================================================================== diff -u -rc4ca818226091ff5168f56410853ab680995080e -r37a53b1ca9a4cdfc6e6df7f065cd540c627f2622 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs (.../HeightStructuresContextTest.cs) (revision c4ca818226091ff5168f56410853ab680995080e) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Forms.Test/PresentationObjects/HeightStructuresContextTest.cs (.../HeightStructuresContextTest.cs) (revision 37a53b1ca9a4cdfc6e6df7f065cd540c627f2622) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using System.Linq; using Core.Common.Base; using Core.Common.Controls.PresentationObjects; using Core.Common.TestUtil; @@ -28,6 +29,7 @@ using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HeightStructures.Data; using Ringtoets.HeightStructures.Forms.PresentationObjects; +using Ringtoets.HydraRing.Data; namespace Ringtoets.HeightStructures.Forms.Test.PresentationObjects { @@ -97,6 +99,29 @@ mockRepository.VerifyAll(); } + [Test] + public void AvailableHydraulicBoundaryLocations_HydraulicBoundaryDatabaseSet_ReturnsAllHydraulicBoundaryLocations() + { + // Setup + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "name", 1.1, 2.2)); + var assessmentSectionMock = mockRepository.StrictMock(); + assessmentSectionMock.Expect(asm => asm.HydraulicBoundaryDatabase).Return(hydraulicBoundaryDatabase).Repeat.Twice(); + mockRepository.ReplayAll(); + + var failureMechanism = new HeightStructuresFailureMechanism(); + var target = new ObservableObject(); + var context = new SimpleHeightStructuresContext(target, failureMechanism, assessmentSectionMock); + + // Call + var availableHydraulicBoundaryLocations = context.AvailableHydraulicBoundaryLocations; + + // Assert + Assert.AreEqual(1, availableHydraulicBoundaryLocations.Count()); + Assert.AreEqual(hydraulicBoundaryDatabase.Locations, availableHydraulicBoundaryLocations); + mockRepository.VerifyAll(); + } + private class ObservableObject : Observable {} private class SimpleHeightStructuresContext : HeightStructuresContext where T : IObservable