Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs
===================================================================
diff -u -r56ff0f1d920928ea93ba1a739936bca2df327391 -rac4b9f3c4545c1bcb9a688d4613e61635e9ad2a8
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision 56ff0f1d920928ea93ba1a739936bca2df327391)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssessmentSectionView.cs (.../AssessmentSectionView.cs) (revision ac4b9f3c4545c1bcb9a688d4613e61635e9ad2a8)
@@ -19,9 +19,11 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System.Linq;
using System.Windows.Forms;
using Core.Components.DotSpatial.Forms;
using Core.Components.Gis;
+using Core.Components.Gis.Data;
using Core.Plugins.DotSpatial.Forms;
using Ringtoets.Integration.Data;
@@ -59,17 +61,26 @@
if (data != null)
{
- //TODO set data to map.
+ Map.Data = GetHydraulicBoudaryLocations(data);
}
}
}
+ ///
+ /// Gets the object.
+ ///
public IMap Map
{
get
{
return map;
}
}
+
+ private MapData GetHydraulicBoudaryLocations(AssessmentSectionBase assessmentSectionBase)
+ {
+ var locations = assessmentSectionBase.HydraulicBoundaryDatabase.Locations.Select(h => h.Location).ToList();
+ return new MapPointData(locations);
+ }
}
}
\ No newline at end of file
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs
===================================================================
diff -u -r56ff0f1d920928ea93ba1a739936bca2df327391 -rac4b9f3c4545c1bcb9a688d4613e61635e9ad2a8
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision 56ff0f1d920928ea93ba1a739936bca2df327391)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssessmentSectionViewTest.cs (.../AssessmentSectionViewTest.cs) (revision ac4b9f3c4545c1bcb9a688d4613e61635e9ad2a8)
@@ -19,10 +19,15 @@
// Stichting Deltares and remain full property of Stichting Deltares at all times.
// All rights reserved.
+using System.Collections.Generic;
using System.Windows.Forms;
using Core.Common.Controls.Views;
using Core.Components.DotSpatial.Forms;
+using Core.Components.Gis.Data;
using NUnit.Framework;
+using Ringtoets.Common.Data;
+using Ringtoets.HydraRing.Data;
+using Ringtoets.Integration.Data;
using Ringtoets.Integration.Forms.Views;
namespace Ringtoets.Integration.Forms.Test.Views
@@ -71,5 +76,30 @@
Assert.DoesNotThrow(testDelegate);
Assert.IsNull(map.Data);
}
+
+ [Test]
+ public void Data_SetToMapPointData_MapDataSet()
+ {
+ // Setup
+ var view = new AssessmentSectionView();
+ var map = (BaseMap)view.Controls[0];
+ var assessmentSectionBase = new AssessmentSectionBaseTestClass();
+ assessmentSectionBase.HydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "test", 1.0, 2.0, "level"));
+
+ // Call
+ view.Data = assessmentSectionBase;
+
+ // Assert
+ Assert.AreSame(assessmentSectionBase, view.Data);
+ Assert.IsInstanceOf(map.Data);
+ }
+
+ private class AssessmentSectionBaseTestClass : AssessmentSectionBase
+ {
+ public override IEnumerable GetFailureMechanisms()
+ {
+ yield break;
+ }
+ }
}
}