Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs =================================================================== diff -u -r115427a54b9613bc94bb2ad873c232e725c48284 -r3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs (.../HydraulicLocationConfigurationDatabaseUpdateHandler.cs) (revision 115427a54b9613bc94bb2ad873c232e725c48284) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandler.cs (.../HydraulicLocationConfigurationDatabaseUpdateHandler.cs) (revision 3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2) @@ -19,11 +19,15 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; using System.Collections.Generic; +using System.Windows.Forms; using Core.Common.Base; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.HydraRing.IO.HydraulicLocationConfigurationDatabase; using Ringtoets.Integration.IO.Handlers; +using Ringtoets.Integration.Plugin.Properties; +using CoreCommonBaseResources = Core.Common.Base.Properties.Resources; namespace Ringtoets.Integration.Plugin.Handlers { @@ -34,14 +38,17 @@ { public bool InquireConfirmation() { - throw new System.NotImplementedException(); + DialogResult result = MessageBox.Show(Resources.HydraulicLocationConfigurationDatabaseUpdateHandler_Confirm_clear_hydraulicLocationConfigurationDatabase_dependent_data, + CoreCommonBaseResources.Confirm, + MessageBoxButtons.OKCancel); + return result == DialogResult.OK; } public IEnumerable Update(HydraulicBoundaryDatabase hydraulicBoundaryDatabase, ReadHydraulicLocationConfigurationDatabaseSettings readHydraulicLocationConfigurationDatabaseSettings, string hlcdFilePath) { - throw new System.NotImplementedException(); + throw new NotImplementedException(); } } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r82bd67cbda97ba7d3752b92b7e642135eba30601 -r3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 82bd67cbda97ba7d3752b92b7e642135eba30601) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2) @@ -352,6 +352,18 @@ } /// + /// Looks up a localized string similar to U heeft een ander HLCD bestand geselecteerd. Als gevolg hiervan moet de uitvoer van alle HB berekeningen verwijderd worden. + /// + ///Wilt u doorgaan?. + /// + public static string HydraulicLocationConfigurationDatabaseUpdateHandler_Confirm_clear_hydraulicLocationConfigurationDatabase_dependent_data { + get { + return ResourceManager.GetString("HydraulicLocationConfigurationDatabaseUpdateHandler_Confirm_clear_hydraulicLocati" + + "onConfigurationDatabase_dependent_data", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Na het importeren van een aangepaste ligging van de referentielijn zullen alle geïmporteerde en berekende gegevens van alle toetssporen worden gewist. /// ///Wilt u doorgaan?. Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -r82bd67cbda97ba7d3752b92b7e642135eba30601 -r3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 82bd67cbda97ba7d3752b92b7e642135eba30601) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2) @@ -229,4 +229,9 @@ Hydraulische belastingendatabase + + U heeft een ander HLCD bestand geselecteerd. Als gevolg hiervan moet de uitvoer van alle HB berekeningen verwijderd worden. + +Wilt u doorgaan? + \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandlerTest.cs =================================================================== diff -u -rc14610150a92e51bb9c1df0b7468fca4109ae7cc -r3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandlerTest.cs (.../HydraulicLocationConfigurationDatabaseUpdateHandlerTest.cs) (revision c14610150a92e51bb9c1df0b7468fca4109ae7cc) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/HydraulicLocationConfigurationDatabaseUpdateHandlerTest.cs (.../HydraulicLocationConfigurationDatabaseUpdateHandlerTest.cs) (revision 3b3fa6dd98a09b88cb6f211f3e56ac1fafcc01f2) @@ -19,14 +19,16 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using NUnit.Extensions.Forms; using NUnit.Framework; using Ringtoets.Integration.IO.Handlers; using Ringtoets.Integration.Plugin.Handlers; namespace Ringtoets.Integration.Plugin.Test.Handlers { [TestFixture] - public class HydraulicLocationConfigurationDatabaseUpdateHandlerTest + public class HydraulicLocationConfigurationDatabaseUpdateHandlerTest : NUnitFormTest { [Test] public void Constructor_ExpectedValues() @@ -37,5 +39,43 @@ // Assert Assert.IsInstanceOf(handler); } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void InquireConfirmation_ClickDialog_ReturnsExpectedResult(bool clickOk) + { + // Setup + string dialogTitle = null, dialogMessage = null; + DialogBoxHandler = (name, wnd) => + { + var tester = new MessageBoxTester(wnd); + dialogTitle = tester.Title; + dialogMessage = tester.Text; + if (clickOk) + { + tester.ClickOk(); + } + else + { + tester.ClickCancel(); + } + }; + + var handler = new HydraulicLocationConfigurationDatabaseUpdateHandler(); + + // Call + bool result = handler.InquireConfirmation(); + + // Assert + Assert.AreEqual(clickOk, result); + + Assert.AreEqual("Bevestigen", dialogTitle); + Assert.AreEqual("U heeft een ander HLCD bestand geselecteerd. Als gevolg hiervan moet de uitvoer van alle HB berekeningen verwijderd worden." + + Environment.NewLine + + Environment.NewLine + + "Wilt u doorgaan?", + dialogMessage); + } } } \ No newline at end of file