Index: Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs =================================================================== diff -u -r9c62dbc3f18cb81172af025c25ef3cc7b5578035 -r47237ae4fc638dcb485ec8100e22c63037a744e1 --- Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs (.../DataImportHelper.cs) (revision 9c62dbc3f18cb81172af025c25ef3cc7b5578035) +++ Ringtoets/Integration/test/Ringtoets.Integration.TestUtil/DataImportHelper.cs (.../DataImportHelper.cs) (revision 47237ae4fc638dcb485ec8100e22c63037a744e1) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2017. All rights reserved. +// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of Ringtoets. // @@ -19,6 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -36,7 +37,8 @@ using Ringtoets.Common.IO.ReferenceLines; using Ringtoets.Common.IO.SoilProfile; using Ringtoets.Common.IO.SurfaceLines; -using Ringtoets.Integration.Data; +using Ringtoets.DuneErosion.Plugin.Handlers; +using Ringtoets.Integration.IO.Importers; using Ringtoets.Integration.Plugin.Handlers; using Ringtoets.MacroStabilityInwards.Data; using Ringtoets.MacroStabilityInwards.Data.SoilProfile; @@ -46,6 +48,7 @@ using Ringtoets.Piping.Data.SoilProfile; using Ringtoets.Piping.Plugin.FileImporter; using Ringtoets.Piping.Primitives; +using Riskeer.Integration.Data; using PipingSurfaceLinesCsvImporterConfigurationFactory = Ringtoets.Piping.Plugin.FileImporter.SurfaceLinesCsvImporterConfigurationFactory; using MacroStabilityInwardsSurfaceLinesCsvImporterConfigurationFactory = Ringtoets.MacroStabilityInwards.Plugin.FileImporter.SurfaceLinesCsvImporterConfigurationFactory; @@ -73,8 +76,8 @@ var mocks = new MockRepository(); var viewCommands = mocks.Stub(); mocks.ReplayAll(); - var activity = new FileImportActivity(new ReferenceLineImporter(assessmentSection, - new ReferenceLineReplacementHandler(viewCommands), + var activity = new FileImportActivity(new ReferenceLineImporter(assessmentSection.ReferenceLine, + new ReferenceLineUpdateHandler(assessmentSection, viewCommands), filePath), "ReferenceLineImporter"); activity.Run(); @@ -158,24 +161,51 @@ } /// - /// 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) { using (var embeddedResourceFileWriter = new EmbeddedResourceFileWriter(typeof(DataImportHelper).Assembly, false, "HRD dutch coast south.sqlite", "HLCD.sqlite", "HRD dutch coast south.config.sqlite")) - using (var hydraulicBoundaryDatabaseImporter = new HydraulicBoundaryDatabaseImporter()) { string filePath = Path.Combine(embeddedResourceFileWriter.TargetFolderPath, "HRD dutch coast south.sqlite"); - hydraulicBoundaryDatabaseImporter.Import(assessmentSection, filePath); + + ImportHydraulicBoundaryDatabase(assessmentSection, filePath); } } + /// + /// Imports the for the given . + /// + /// The to import on. + /// The filePath to import from. + /// Thrown when + /// is null. + 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) { return new FailureMechanismSection(section.Name,