Index: Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs =================================================================== diff -u -r5696d81a484c2828f1d00f7a5cb778590821259d -r1c1fa5b3ce99957897dc245c62aa508724b1ceb3 --- Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 5696d81a484c2828f1d00f7a5cb778590821259d) +++ Ringtoets/Integration/test/Ringtoets.Integration.IO.Test/Importers/HydraulicLocationConfigurationDatabaseImporterTest.cs (.../HydraulicLocationConfigurationDatabaseImporterTest.cs) (revision 1c1fa5b3ce99957897dc245c62aa508724b1ceb3) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2018. All rights reserved. +// Copyright (C) Stichting Deltares 2018. All rights reserved. // // This file is part of Ringtoets. // @@ -463,6 +463,46 @@ mocks.VerifyAll(); } + [Test] + public void DoPostImportUpdates_WhenImportSuccessful_NotifyObserversOfReturnedObjects() + { + // Setup + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = validHrdFilePath + }; + + var mocks = new MockRepository(); + var observable1 = mocks.StrictMock(); + observable1.Expect(o => o.NotifyObservers()); + var observable2 = mocks.StrictMock(); + observable2.Expect(o => o.NotifyObservers()); + + var handler = mocks.StrictMock(); + handler.Expect(h => h.InquireConfirmation()).Return(true); + handler.Expect(h => h.Update(Arg.Is.NotNull, + Arg.Is.Null, + Arg.Is.NotNull)) + .Return(new[] + { + observable1, + observable2 + }); + mocks.ReplayAll(); + + var importer = new HydraulicLocationConfigurationDatabaseImporter(hydraulicBoundaryDatabase.HydraulicLocationConfigurationSettings, handler, + hydraulicBoundaryDatabase, validHlcdFilePath); + + // Precondition + Assert.IsTrue(importer.Import()); + + // Call + importer.DoPostImport(); + + // Assert + mocks.VerifyAll(); // Expect NotifyObservers on updated observables + } + private static void AssertImportFailed(Action call, string errorMessage, ref bool importSuccessful) { string expectedMessage = $"{errorMessage}" +