Index: Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs (.../HydraulicBoundaryLocationsExporter.cs) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/Common/src/Ringtoets.Common.IO/HydraulicBoundaryLocationsExporter.cs (.../HydraulicBoundaryLocationsExporter.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -41,6 +41,7 @@ private readonly IEnumerable hydraulicBoundaryLocations; private readonly string filePath; private readonly string designWaterLevelName; + private readonly string waveHeightName; /// /// Creates a new instance of . @@ -49,32 +50,38 @@ /// The path of the file to export to. /// The Dutch name of the content of the /// property. - /// Thrown when - /// or is null. + /// The Dutch name of the content of the + /// property. + /// Thrown when , + /// or is null. /// Thrown when is invalid. public HydraulicBoundaryLocationsExporter(IEnumerable hydraulicBoundaryLocations, - string filePath, string designWaterLevelName) + string filePath, string designWaterLevelName, string waveHeightName) { if (hydraulicBoundaryLocations == null) { throw new ArgumentNullException("hydraulicBoundaryLocations"); } - if (designWaterLevelName == null) { throw new ArgumentNullException("designWaterLevelName"); } + if (waveHeightName == null) + { + throw new ArgumentNullException("waveHeightName"); + } FileUtils.ValidateFilePath(filePath); this.hydraulicBoundaryLocations = hydraulicBoundaryLocations; this.filePath = filePath; this.designWaterLevelName = designWaterLevelName; + this.waveHeightName = waveHeightName; } public bool Export() { - var hydraulicBoundaryLocationsWriter = new HydraulicBoundaryLocationsWriter(designWaterLevelName); + var hydraulicBoundaryLocationsWriter = new HydraulicBoundaryLocationsWriter(designWaterLevelName, waveHeightName); try { Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs =================================================================== diff -u -rbd9849dce7ed90ca3d20be6431b8f0066b9684a9 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision bd9849dce7ed90ca3d20be6431b8f0066b9684a9) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -41,7 +41,7 @@ string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, "test.shp"); // Call - var hydraulicBoundaryLocationsExporter = new HydraulicBoundaryLocationsExporter(Enumerable.Empty(), filePath, "aName"); + var hydraulicBoundaryLocationsExporter = new HydraulicBoundaryLocationsExporter(Enumerable.Empty(), filePath, "Toetspeil", "Golfhoogte"); // Assert Assert.IsInstanceOf(hydraulicBoundaryLocationsExporter); @@ -54,7 +54,7 @@ string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, "test.shp"); // Call - TestDelegate call = () => new HydraulicBoundaryLocationsExporter(null, filePath, "aName"); + TestDelegate call = () => new HydraulicBoundaryLocationsExporter(null, filePath, "Toetspeil", "Golfhoogte"); // Assert var exception = Assert.Throws(call); @@ -75,7 +75,7 @@ TestDelegate call = () => new HydraulicBoundaryLocationsExporter(new[] { hydraulicBoundaryLocation - }, null, "aName"); + }, null, "Toetspeil", "Golfhoogte"); // Assert Assert.Throws(call); @@ -97,14 +97,37 @@ TestDelegate call = () => new HydraulicBoundaryLocationsExporter(new[] { hydraulicBoundaryLocation - }, filePath, null); + }, filePath, null, "Golfhoogte"); // Assert var exception = Assert.Throws(call); Assert.AreEqual("designWaterLevelName", exception.ParamName); } [Test] + public void Constructor_WaveHeightNameNull_ThrowArgumentNullException() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) + { + DesignWaterLevel = (RoundedDouble)111.111, + WaveHeight = (RoundedDouble)222.222 + }; + + string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, "test.shp"); + + // Call + TestDelegate call = () => new HydraulicBoundaryLocationsExporter(new[] + { + hydraulicBoundaryLocation + }, filePath, "Toetspeil", null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("waveHeightName", exception.ParamName); + } + + [Test] public void Export_ValidData_ReturnTrueAndWritesFile() { // Setup @@ -123,7 +146,7 @@ var exporter = new HydraulicBoundaryLocationsExporter(new[] { hydraulicBoundaryLocation - }, filePath, "aName"); + }, filePath, "Toetspeil", "Golfhoogte"); bool isExported; try @@ -161,7 +184,7 @@ var exporter = new HydraulicBoundaryLocationsExporter(new[] { hydraulicBoundaryLocation - }, filePath, "Toetspeil"); + }, filePath, "Toetspeil", "Golfhoogte"); // Precondition AssertEssentialShapefileExists(directoryPath, baseName, false); @@ -199,7 +222,7 @@ var exporter = new HydraulicBoundaryLocationsExporter(new[] { hydraulicBoundaryLocation - }, filePath, "aName"); + }, filePath, "Toetspeil", "Golfhoogte"); try { Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -r1042a38d3663daeda5a8e1083edbc63a4b6aae94 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 1042a38d3663daeda5a8e1083edbc63a4b6aae94) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -142,7 +142,7 @@ { CreateFileExporter = (context, filePath) => new HydraulicBoundaryLocationsExporter(context.WrappedData.GrassCoverErosionOutwardsHydraulicBoundaryLocations, - filePath, Properties.Resources.DesignWaterLevel_Description), + filePath, Properties.Resources.DesignWaterLevel_Description, Properties.Resources.WaveHeight_Description), IsEnabled = context => context.WrappedData.GrassCoverErosionOutwardsHydraulicBoundaryLocations.Count > 0, FileFilter = RingtoetsCommonIoResources.DataTypeDisplayName_shape_file_filter }; Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -rbd9849dce7ed90ca3d20be6431b8f0066b9684a9 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bd9849dce7ed90ca3d20be6431b8f0066b9684a9) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -89,5 +89,14 @@ return ResourceManager.GetString("DesignWaterLevel_Description", resourceCulture); } } + + /// + /// Looks up a localized string similar to Golfhoogte bij doorsnede-eis. + /// + internal static string WaveHeight_Description { + get { + return ResourceManager.GetString("WaveHeight_Description", resourceCulture); + } + } } } Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.resx =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.resx (.../Resources.resx) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -101,4 +101,7 @@ Waterstand bij doorsnede-eis + + Golfhoogte bij doorsnede-eis + \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionOutwards.Plugin.csproj) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/Ringtoets.GrassCoverErosionOutwards.Plugin.csproj (.../Ringtoets.GrassCoverErosionOutwards.Plugin.csproj) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -120,6 +120,7 @@ ResXFileCodeGenerator Resources.Designer.cs + Designer Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -39,21 +39,30 @@ public class HydraulicBoundaryLocationsWriter { private readonly string designWaterLevelName; + private readonly string waveHeightName; /// /// Creates a new instance of . /// /// The Dutch name of the content of the /// property. - /// Thrown when is null. - public HydraulicBoundaryLocationsWriter(string designWaterLevelName) + /// The Dutch name of the content of the + /// property. + /// Thrown when or + /// is null. + public HydraulicBoundaryLocationsWriter(string designWaterLevelName, string waveHeightName) { if (designWaterLevelName == null) { throw new ArgumentNullException("designWaterLevelName"); } + if (waveHeightName == null) + { + throw new ArgumentNullException("waveHeightName"); + } this.designWaterLevelName = designWaterLevelName; + this.waveHeightName = waveHeightName; } /// @@ -111,7 +120,7 @@ mapFeature.MetaData.Add(Resources.HydraulicBoundaryLocation_Name, hydraulicBoundaryLocation.Name); mapFeature.MetaData.Add(Resources.HydraulicBoundaryLocation_Id, hydraulicBoundaryLocation.Id); mapFeature.MetaData.Add(designWaterLevelName, hydraulicBoundaryLocation.DesignWaterLevel.Value); - mapFeature.MetaData.Add(Resources.HydraulicBoundaryLocation_WaveHeight, hydraulicBoundaryLocation.WaveHeight.Value); + mapFeature.MetaData.Add(waveHeightName, hydraulicBoundaryLocation.WaveHeight.Value); return new MapPointData(hydraulicBoundaryLocation.Name) { Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs =================================================================== diff -u -ra0eac32f05f503713d027f116b0194040418ceb2 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision a0eac32f05f503713d027f116b0194040418ceb2) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -36,22 +36,33 @@ public void ParameteredConstructor_DesignWaterLevelNameNull_ThrowArgumentNullException() { // Call - TestDelegate call = () => new HydraulicBoundaryLocationsWriter(null); + TestDelegate call = () => new HydraulicBoundaryLocationsWriter(null, "bName"); // Assert var exception = Assert.Throws(call); Assert.AreEqual("designWaterLevelName", exception.ParamName); } [Test] + public void ParameteredConstructor_WaveHeightNameNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => new HydraulicBoundaryLocationsWriter("aName", null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("waveHeightName", exception.ParamName); + } + + [Test] public void WriteHydraulicBoundaryLocations_HydraulicBoundaryLocationsNull_ThrowArgumentNullException() { // Setup string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, Path.Combine("WriteHydraulicBoundaryLocations_NullhydraulicBoundaryLocations_ThrowArgumentNullException", "test.shp")); - var writer = new HydraulicBoundaryLocationsWriter("aName"); + var writer = new HydraulicBoundaryLocationsWriter("aName", "bName"); // Call TestDelegate call = () => writer.WriteHydraulicBoundaryLocations(null, filePath); @@ -64,7 +75,7 @@ public void WriteHydraulicBoundaryLocations_FilePathNull_ThrowArgumentNullException() { // Setup - var writer = new HydraulicBoundaryLocationsWriter("aName"); + var writer = new HydraulicBoundaryLocationsWriter("aName", "bName"); // Call TestDelegate call = () => writer.WriteHydraulicBoundaryLocations(Enumerable.Empty(), null); @@ -89,7 +100,7 @@ string filePath = Path.Combine(directoryPath, "test.shp"); var baseName = "test"; - var writer = new HydraulicBoundaryLocationsWriter("Toetspeil"); + var writer = new HydraulicBoundaryLocationsWriter("Toetspeil", "Golfhoogte"); // Precondition AssertEssentialShapefileExists(directoryPath, baseName, false); Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r25dfea7e2fbe8ddc0e2278a8e385506171e86a38 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 25dfea7e2fbe8ddc0e2278a8e385506171e86a38) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -91,6 +91,15 @@ } /// + /// Looks up a localized string similar to Toetspeil. + /// + public static string DesignWaterLevel_Description { + get { + return ResourceManager.GetString("DesignWaterLevel_Description", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Dijkprofiellocaties. /// public static string DikeProfilesImporter_DisplayName { @@ -441,5 +450,14 @@ return ResourceManager.GetString("RingtoetsRibbon_GroupBox_New", resourceCulture); } } + + /// + /// Looks up a localized string similar to Golfhoogte. + /// + public static string WaveHeight_Description { + get { + return ResourceManager.GetString("WaveHeight_Description", resourceCulture); + } + } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -r25dfea7e2fbe8ddc0e2278a8e385506171e86a38 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 25dfea7e2fbe8ddc0e2278a8e385506171e86a38) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -212,4 +212,10 @@ Voorlandprofielen importeren is afgebroken. Geen data ingelezen. + + Toetspeil + + + Golfhoogte + \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r1042a38d3663daeda5a8e1083edbc63a4b6aae94 -r3d27194c4194dd405ab3471818957a64a59a0f19 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 1042a38d3663daeda5a8e1083edbc63a4b6aae94) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 3d27194c4194dd405ab3471818957a64a59a0f19) @@ -433,7 +433,8 @@ yield return new ExportInfo { CreateFileExporter = (context, filePath) => new HydraulicBoundaryLocationsExporter( - context.WrappedData.HydraulicBoundaryDatabase.Locations, filePath, "Toetspeil"), + context.WrappedData.HydraulicBoundaryDatabase.Locations, filePath, + Resources.DesignWaterLevel_Description, Resources.WaveHeight_Description), IsEnabled = context => context.WrappedData.HydraulicBoundaryDatabase != null, FileFilter = RingtoetsCommonIoResources.DataTypeDisplayName_shape_file_filter };