Index: Ringtoets/Integration/src/Ringtoets.Integration.IO/Importers/HydraulicLocationConfigurationDatabaseImporter.cs =================================================================== diff -u -r1c1fa5b3ce99957897dc245c62aa508724b1ceb3 -r9ffa387fc3c1f32b46b09403f5c43e0850aa23f1 --- Ringtoets/Integration/src/Ringtoets.Integration.IO/Importers/HydraulicLocationConfigurationDatabaseImporter.cs (.../HydraulicLocationConfigurationDatabaseImporter.cs) (revision 1c1fa5b3ce99957897dc245c62aa508724b1ceb3) +++ Ringtoets/Integration/src/Ringtoets.Integration.IO/Importers/HydraulicLocationConfigurationDatabaseImporter.cs (.../HydraulicLocationConfigurationDatabaseImporter.cs) (revision 9ffa387fc3c1f32b46b09403f5c43e0850aa23f1) @@ -77,6 +77,13 @@ protected override bool OnImport() { + InquireConfirmation(); + + if (Canceled) + { + return false; + } + if (Path.GetDirectoryName(FilePath) != Path.GetDirectoryName(hydraulicBoundaryDatabase.FilePath)) { Log.Error(BuildErrorMessage(FilePath, Resources.HydraulicLocationConfigurationDatabaseImporter_HLCD_not_in_same_folder_as_HRD)); @@ -106,15 +113,8 @@ return false; } - InquireConfirmation(); - - if (Canceled) - { - return false; - } - AddHydraulicLocationConfigurationSettingsToDataModel( - readHydraulicLocationConfigurationDatabase.ReadHydraulicLocationConfigurationDatabaseSettings.SingleOrDefault()); + readHydraulicLocationConfigurationDatabase.ReadHydraulicLocationConfigurationDatabaseSettings?.Single()); return true; } Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs =================================================================== diff -u -r1c1fa5b3ce99957897dc245c62aa508724b1ceb3 -r9ffa387fc3c1f32b46b09403f5c43e0850aa23f1 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 1c1fa5b3ce99957897dc245c62aa508724b1ceb3) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 9ffa387fc3c1f32b46b09403f5c43e0850aa23f1) @@ -98,6 +98,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string hydraulicBoundaryDatabasePath = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.IO, @@ -126,6 +127,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string path = Path.Combine(testDataPath, "CorruptHrd"); @@ -154,6 +156,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string path = Path.Combine(testDataPath, "EmptyHrd"); @@ -182,6 +185,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string path = Path.Combine(testDataPath, "empty.sqlite"); @@ -210,6 +214,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string path = Path.Combine(testDataPath, "invalid.sqlite"); @@ -240,6 +245,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); string path = Path.Combine(testDataPath, $"{fileName}.sqlite"); @@ -306,6 +312,7 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); + handler.Stub(h => h.InquireConfirmation()).Return(true); mocks.ReplayAll(); var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase