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 {