Index: Core/Common/test/Core.Common.TestUtil/TestDataPath.cs =================================================================== diff -u -r2a81f01756e227d5ce93717b21b87e8a5cd5fcbb -r63520df04e8830481e16d35b466f99a4f2276406 --- Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision 2a81f01756e227d5ce93717b21b87e8a5cd5fcbb) +++ Core/Common/test/Core.Common.TestUtil/TestDataPath.cs (.../TestDataPath.cs) (revision 63520df04e8830481e16d35b466f99a4f2276406) @@ -100,6 +100,7 @@ public static readonly TestDataPath Service = System.IO.Path.Combine("Ringtoets", "Integration", "test", "Ringtoets.Integration.Service.Test"); public static readonly TestDataPath IO = System.IO.Path.Combine("Ringtoets", "Integration", "test", "Ringtoets.Integration.IO.Test"); public static readonly TestDataPath Plugin = System.IO.Path.Combine("Ringtoets", "Integration", "test", "Ringtoets.Integration.Plugin.Test"); + public static readonly TestDataPath TestUtil = System.IO.Path.Combine("Ringtoets", "Integration", "test", "ringtoets.Integration.TestUtil.Test"); } public static class MacroStabilityInwards Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs =================================================================== diff -u -r6fe6de1da8b6f96e89137531a9aa49e67beedad4 -r63520df04e8830481e16d35b466f99a4f2276406 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs (.../DataImportHelperTest.cs) (revision 6fe6de1da8b6f96e89137531a9aa49e67beedad4) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/DataImportHelperTest.cs (.../DataImportHelperTest.cs) (revision 63520df04e8830481e16d35b466f99a4f2276406) @@ -21,7 +21,9 @@ using System; using System.Collections.Generic; +using System.IO; using System.Linq; +using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; @@ -119,6 +121,30 @@ } [Test] + public void ImportHydraulicBoundaryDatabaseWithFilePath_AssessmentSectionNull_ThrowsArgumentNullException() + { + // Call + TestDelegate test = () => DataImportHelper.ImportHydraulicBoundaryDatabase(null, ""); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("assessmentSection", paramName); + } + + [Test] + public void ImportHydraulicBoundaryDatabaseWithFilePath_ValidData_AddsHydraulicBoundaryLocations() + { + // Setup + string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.TestUtil, nameof(DataImportHelper)); + + // Call + DataImportHelper.ImportHydraulicBoundaryDatabase(assessmentSection, Path.Combine(testDataPath, "complete.sqlite")); + + // Assert + Assert.AreEqual(18, assessmentSection.HydraulicBoundaryDatabase.Locations.Count); + } + + [Test] public void ImportPipingSurfaceLines_WithReferenceLine_AddsFourSurfaceLines() { // Setup Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/Ringtoets.Integration.TestUtil.Test.csproj =================================================================== diff -u -r8b8e62bfddfca997d2ed5df4a0c9c72648f1b5b4 -r63520df04e8830481e16d35b466f99a4f2276406 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/Ringtoets.Integration.TestUtil.Test.csproj (.../Ringtoets.Integration.TestUtil.Test.csproj) (revision 8b8e62bfddfca997d2ed5df4a0c9c72648f1b5b4) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/Ringtoets.Integration.TestUtil.Test.csproj (.../Ringtoets.Integration.TestUtil.Test.csproj) (revision 63520df04e8830481e16d35b466f99a4f2276406) @@ -31,6 +31,10 @@ {3bbfd65b-b277-4e50-ae6d-bd24c3434609} Core.Common.Base + + {D749EE4C-CE50-4C17-BF01-9A953028C126} + Core.Common.TestUtil + {c6309704-d67b-434c-bc98-9f8910bc1d10} Ringtoets.ClosingStructures.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/test-data/DataImportHelper/HLCD.sqlite =================================================================== diff -u Binary files differ Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/test-data/DataImportHelper/complete.config.sqlite =================================================================== diff -u Binary files differ Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil.Test/test-data/DataImportHelper/complete.sqlite =================================================================== diff -u Binary files differ Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs =================================================================== diff -u -r13985ac089d88ef0eb5050dddd2e403d126e0d6d -r63520df04e8830481e16d35b466f99a4f2276406 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs (.../DataImportHelper.cs) (revision 13985ac089d88ef0eb5050dddd2e403d126e0d6d) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs (.../DataImportHelper.cs) (revision 63520df04e8830481e16d35b466f99a4f2276406) @@ -161,17 +161,12 @@ } /// - /// Imports the for the given . + /// Imports the for the given . /// /// The to import on. - /// This will import 19 Hydraulic boundary locations. + /// This will import 18 Hydraulic boundary locations. public static void ImportHydraulicBoundaryDatabase(AssessmentSection assessmentSection) { - if (assessmentSection == null) - { - throw new ArgumentNullException(nameof(assessmentSection)); - } - using (var embeddedResourceFileWriter = new EmbeddedResourceFileWriter(typeof(DataImportHelper).Assembly, false, "HRD dutch coast south.sqlite", @@ -180,18 +175,34 @@ { string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "HRD dutch coast south.sqlite"); - var mocks = new MockRepository(); - var viewCommands = mocks.Stub(); - mocks.ReplayAll(); + ImportHydraulicBoundaryDatabase(assessmentSection, filePath); + } + } - var hydraulicBoundaryDatabaseImporter = new HydraulicBoundaryDatabaseImporter(assessmentSection.HydraulicBoundaryDatabase, - new HydraulicBoundaryDatabaseUpdateHandler( - assessmentSection, - new DuneLocationsReplacementHandler(viewCommands, assessmentSection.DuneErosion)), - filePath); - hydraulicBoundaryDatabaseImporter.Import(); - mocks.VerifyAll(); + /// + /// Imports the for the given . + /// + /// The to import on. + /// The filePath to import from. + /// This will import 18 Hydraulic boundary locations. + public static void ImportHydraulicBoundaryDatabase(AssessmentSection assessmentSection, string filePath) + { + if (assessmentSection == null) + { + throw new ArgumentNullException(nameof(assessmentSection)); } + + var mocks = new MockRepository(); + var viewCommands = mocks.Stub(); + mocks.ReplayAll(); + + var hydraulicBoundaryDatabaseImporter = new HydraulicBoundaryDatabaseImporter(assessmentSection.HydraulicBoundaryDatabase, + new HydraulicBoundaryDatabaseUpdateHandler( + assessmentSection, + new DuneLocationsReplacementHandler(viewCommands, assessmentSection.DuneErosion)), + filePath); + hydraulicBoundaryDatabaseImporter.Import(); + mocks.VerifyAll(); } private static FailureMechanismSection DeepCloneSection(FailureMechanismSection section)