Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs =================================================================== diff -u -r683e5dc59d2690c17d88919223f7fbaf332974a7 -r5696d81a484c2828f1d00f7a5cb778590821259d --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 683e5dc59d2690c17d88919223f7fbaf332974a7) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 5696d81a484c2828f1d00f7a5cb778590821259d) @@ -335,6 +335,44 @@ } [Test] + public void Import_CancelImportDuringAddReadDataToDataModel_ContinuesImportAndLogs() + { + // Setup + var mocks = new MockRepository(); + var handler = mocks.Stub(); + handler.Stub(h => h.InquireConfirmation()).Return(true); + handler.Stub(h => h.Update(null, null, null)).IgnoreArguments().Return(Enumerable.Empty()); + mocks.ReplayAll(); + + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = validHrdFilePath + }; + + var importer = new HydraulicLocationConfigurationDatabaseImporter(new HydraulicLocationConfigurationSettings(), handler, + hydraulicBoundaryDatabase, validHlcdFilePath); + importer.SetProgressChanged((description, step, steps) => + { + if (step == totalNumberOfSteps) + { + importer.Cancel(); + } + }); + + var importResult = true; + + // Call + importer.Import(); + Action call = () => importResult = importer.Import(); + + // Assert + const string expectedMessage = "Huidige actie was niet meer te annuleren en is daarom voortgezet."; + TestHelper.AssertLogMessageWithLevelIsGenerated(call, Tuple.Create(expectedMessage, LogLevelConstant.Warn), 1); + Assert.IsTrue(importResult); + mocks.VerifyAll(); + } + + [Test] public void Import_CancelImportDuringDialogInteraction_GenerateCanceledLogMessageAndReturnsFalse() { // Setup