Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs =================================================================== diff -u -r3a3b726aad1fb814bd89643bebe825692f16b13c -r213009c55db126accc5c1a525986abdfa7b90fa4 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 3a3b726aad1fb814bd89643bebe825692f16b13c) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 213009c55db126accc5c1a525986abdfa7b90fa4) @@ -328,6 +328,35 @@ mocks.VerifyAll(); } + [Test] + public void Import_CancelImportDuringDialogInteraction_GenerateCanceledLogMessageAndReturnsFalse() + { + // Setup + var mocks = new MockRepository(); + var handler = mocks.StrictMock(); + handler.Expect(h => h.InquireConfirmation()).Return(false); + mocks.ReplayAll(); + + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = validHrdFilePath + }; + + var importer = new HydraulicLocationConfigurationDatabaseImporter(new HydraulicLocationConfigurationSettings(), handler, + hydraulicBoundaryDatabase, validHlcdFilePath); + + var importResult = true; + + // Call + Action call = () => importResult = importer.Import(); + + // Assert + const string expectedMessage = "HLCD importeren afgebroken. Geen gegevens gewijzigd."; + TestHelper.AssertLogMessageWithLevelIsGenerated(call, Tuple.Create(expectedMessage, LogLevelConstant.Info), 1); + Assert.IsFalse(importResult); + mocks.VerifyAll(); + } + private static void AssertImportFailed(Action call, string errorMessage, ref bool importSuccessful) { string expectedMessage = $"{errorMessage}" +