Index: Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs =================================================================== diff -u -r1c7123dc5b7b959127832d4d3f1d7a31eb6946df -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs (.../IReferenceLineUpdateHandler.cs) (revision 1c7123dc5b7b959127832d4d3f1d7a31eb6946df) +++ Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/IReferenceLineUpdateHandler.cs (.../IReferenceLineUpdateHandler.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -36,21 +36,21 @@ /// or not. /// /// true if the update should occur, false otherwise. - bool ConfirmReplace(); + bool ConfirmUpdate(); /// - /// Replaces the of a - /// and propagates the changes to underlying data structure. + /// Updates the with the + /// and its dependent data. /// /// The reference line to be updated. /// The new reference line. - /// All objects that have been affected by the replacement. + /// All objects that have been affected by the update. /// Thrown when any parameter is null. - IEnumerable Replace(ReferenceLine originalReferenceLine, ReferenceLine newReferenceLine); + IEnumerable Update(ReferenceLine originalReferenceLine, ReferenceLine newReferenceLine); /// - /// Perform post-replacement updates. + /// Perform post-update actions. /// - void DoPostReplacementUpdates(); + void DoPostUpdateActions(); } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs =================================================================== diff -u -r1c7123dc5b7b959127832d4d3f1d7a31eb6946df -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs (.../ReferenceLineImporter.cs) (revision 1c7123dc5b7b959127832d4d3f1d7a31eb6946df) +++ Ringtoets/Common/src/Ringtoets.Common.IO/ReferenceLines/ReferenceLineImporter.cs (.../ReferenceLineImporter.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -84,7 +84,7 @@ protected override void DoPostImportUpdates() { - updateHandler.DoPostReplacementUpdates(); + updateHandler.DoPostUpdateActions(); base.DoPostImportUpdates(); @@ -100,7 +100,7 @@ if (ImportTarget.Points.Any()) { - if (!updateHandler.ConfirmReplace()) + if (!updateHandler.ConfirmUpdate()) { Cancel(); } @@ -153,7 +153,7 @@ 3, 3); } - changedObservables.AddRange(updateHandler.Replace(ImportTarget, importedReferenceLine).Where(o => !ReferenceEquals(o, ImportTarget))); + changedObservables.AddRange(updateHandler.Update(ImportTarget, importedReferenceLine).Where(o => !ReferenceEquals(o, ImportTarget))); } } } \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs =================================================================== diff -u -re949ab20d487bf97ab1cedf2b360fdb1f948419f -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/FileImporters/FailureMechanismSectionsImporterTest.cs (.../FailureMechanismSectionsImporterTest.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -742,9 +742,9 @@ var mocks = new MockRepository(); var handler = mocks.Stub(); - handler.Stub(h => h.ConfirmReplace()).Return(true); - handler.Stub(h => h.Replace(Arg.Is.NotNull, - Arg.Is.NotNull)) + handler.Stub(h => h.ConfirmUpdate()).Return(true); + handler.Stub(h => h.Update(Arg.Is.NotNull, + Arg.Is.NotNull)) .WhenCalled(invocation => referenceLine = (ReferenceLine) invocation.Arguments[1]) .Return(Enumerable.Empty()); mocks.ReplayAll(); Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs =================================================================== diff -u -r1c7123dc5b7b959127832d4d3f1d7a31eb6946df -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision 1c7123dc5b7b959127832d4d3f1d7a31eb6946df) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/ReferenceLines/ReferenceLineImporterTest.cs (.../ReferenceLineImporterTest.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -75,8 +75,8 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); - handler.Expect(h => h.Replace(Arg.Is.NotNull, - Arg.Is.NotNull)) + handler.Expect(h => h.Update(Arg.Is.NotNull, + Arg.Is.NotNull)) .WhenCalled(invocation => { var importedReferenceLine = (ReferenceLine) invocation.Arguments[1]; @@ -107,8 +107,8 @@ // Setup var mocks = new MockRepository(); var handler = mocks.Stub(); - handler.Expect(h => h.Replace(Arg.Is.NotNull, - Arg.Is.NotNull)) + handler.Expect(h => h.Update(Arg.Is.NotNull, + Arg.Is.NotNull)) .Return(Enumerable.Empty()); mocks.ReplayAll(); @@ -154,9 +154,9 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); - handler.Expect(h => h.ConfirmReplace()) + handler.Expect(h => h.ConfirmUpdate()) .Repeat.Never(); - handler.Expect(h => h.Replace(null, null)) + handler.Expect(h => h.Update(null, null)) .IgnoreArguments() .Repeat.Never(); mocks.ReplayAll(); @@ -183,9 +183,9 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); - handler.Expect(h => h.ConfirmReplace()) + handler.Expect(h => h.ConfirmUpdate()) .Repeat.Never(); - handler.Expect(h => h.Replace(null, null)) + handler.Expect(h => h.Update(null, null)) .IgnoreArguments() .Repeat.Never(); mocks.ReplayAll(); @@ -212,8 +212,8 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); - handler.Expect(h => h.ConfirmReplace()).Return(false); - handler.Expect(h => h.Replace(null, null)) + handler.Expect(h => h.ConfirmUpdate()).Return(false); + handler.Expect(h => h.Update(null, null)) .IgnoreArguments() .Repeat.Never(); mocks.ReplayAll(); @@ -241,10 +241,10 @@ var mocks = new MockRepository(); var handler = mocks.StrictMock(); var importer = new ReferenceLineImporter(ReferenceLineTestFactory.CreateReferenceLineWithGeometry(), handler, path); - handler.Expect(h => h.ConfirmReplace()) + handler.Expect(h => h.ConfirmUpdate()) .WhenCalled(invocation => importer.Cancel()) .Return(acceptRemovalOfReferenceLineDependentData); - handler.Expect(h => h.Replace(null, null)) + handler.Expect(h => h.Update(null, null)) .IgnoreArguments() .Repeat.Never(); mocks.ReplayAll(); @@ -268,7 +268,7 @@ var mocks = new MockRepository(); var handler = mocks.Stub(); - handler.Stub(h => h.ConfirmReplace()) + handler.Stub(h => h.ConfirmUpdate()) .Return(true); mocks.ReplayAll(); @@ -300,10 +300,10 @@ var mocks = new MockRepository(); var handler = mocks.Stub(); - handler.Stub(h => h.ConfirmReplace()) + handler.Stub(h => h.ConfirmUpdate()) .Return(true); - handler.Stub(h => h.Replace(Arg.Is.NotNull, - Arg.Is.NotNull)) + handler.Stub(h => h.Update(Arg.Is.NotNull, + Arg.Is.NotNull)) .Return(Enumerable.Empty()); mocks.ReplayAll(); @@ -334,10 +334,10 @@ // Setup var mocks = new MockRepository(); var handler = mocks.StrictMock(); - handler.Expect(h => h.ConfirmReplace()) + handler.Expect(h => h.ConfirmUpdate()) .Repeat.Never(); - handler.Expect(h => h.Replace(Arg.Is.NotNull, - Arg.Is.NotNull)) + handler.Expect(h => h.Update(Arg.Is.NotNull, + Arg.Is.NotNull)) .WhenCalled(invocation => { var importedReferenceLine = (ReferenceLine) invocation.Arguments[1]; @@ -385,15 +385,15 @@ observable2.Expect(o => o.NotifyObservers()); var handler = mocks.StrictMock(); - handler.Expect(h => h.ConfirmReplace()).Return(true); - handler.Expect(h => h.Replace(Arg.Is.Same(referenceLine), - Arg.Is.NotNull)) + handler.Expect(h => h.ConfirmUpdate()).Return(true); + handler.Expect(h => h.Update(Arg.Is.Same(referenceLine), + Arg.Is.NotNull)) .Return(new[] { observable1, observable2 }); - handler.Expect(h => h.DoPostReplacementUpdates()); + handler.Expect(h => h.DoPostUpdateActions()); mocks.ReplayAll(); referenceLine.Attach(referenceLineObserver); @@ -422,10 +422,10 @@ var handler = mocks.StrictMock(); var importer = new ReferenceLineImporter(referenceLine, handler, path); - handler.Expect(h => h.ConfirmReplace()) + handler.Expect(h => h.ConfirmUpdate()) .WhenCalled(invocation => importer.Cancel()) .Return(true); - handler.Expect(h => h.Replace(null, null)) + handler.Expect(h => h.Update(null, null)) .IgnoreArguments() .Repeat.Never(); @@ -460,15 +460,15 @@ observable2.Expect(o => o.NotifyObservers()); var handler = mocks.Stub(); - handler.Stub(h => h.ConfirmReplace()).Return(true); - handler.Expect(h => h.Replace(Arg.Is.Same(referenceLine), - Arg.Is.NotNull)) + handler.Stub(h => h.ConfirmUpdate()).Return(true); + handler.Expect(h => h.Update(Arg.Is.Same(referenceLine), + Arg.Is.NotNull)) .Return(new[] { observable1, observable2 }); - handler.Expect(h => h.DoPostReplacementUpdates()); + handler.Expect(h => h.DoPostUpdateActions()); mocks.ReplayAll(); Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs =================================================================== diff -u -r1c7123dc5b7b959127832d4d3f1d7a31eb6946df -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (.../ReferenceLineUpdateHandler.cs) (revision 1c7123dc5b7b959127832d4d3f1d7a31eb6946df) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Handlers/ReferenceLineUpdateHandler.cs (.../ReferenceLineUpdateHandler.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -65,15 +65,15 @@ this.viewCommands = viewCommands; } - public bool ConfirmReplace() + public bool ConfirmUpdate() { - DialogResult result = MessageBox.Show(Resources.ReferenceLineReplacementHandler_Confirm_clear_referenceLine_dependent_data, + DialogResult result = MessageBox.Show(Resources.ReferenceLineUpdateHandler_Confirm_clear_referenceLine_dependent_data, CoreCommonBaseResources.Confirm, MessageBoxButtons.OKCancel); return result == DialogResult.OK; } - public IEnumerable Replace(ReferenceLine originalReferenceLine, ReferenceLine newReferenceLine) + public IEnumerable Update(ReferenceLine originalReferenceLine, ReferenceLine newReferenceLine) { if (originalReferenceLine == null) { @@ -97,7 +97,7 @@ return results.ChangedObjects; } - public void DoPostReplacementUpdates() + public void DoPostUpdateActions() { while (removedObjects.Count > 0) { Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -r45ccc719b2acf50fa50cf7f790ebb7dceb41e28c -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 45ccc719b2acf50fa50cf7f790ebb7dceb41e28c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -316,9 +316,9 @@ /// ///Wilt u doorgaan?. /// - public static string ReferenceLineReplacementHandler_Confirm_clear_referenceLine_dependent_data { + public static string ReferenceLineUpdateHandler_Confirm_clear_referenceLine_dependent_data { get { - return ResourceManager.GetString("ReferenceLineReplacementHandler_Confirm_clear_referenceLine_dependent_data", resourceCulture); + return ResourceManager.GetString("ReferenceLineUpdateHandler_Confirm_clear_referenceLine_dependent_data", resourceCulture); } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -r45ccc719b2acf50fa50cf7f790ebb7dceb41e28c -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 45ccc719b2acf50fa50cf7f790ebb7dceb41e28c) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -130,7 +130,7 @@ ..\Resources\Foreshore.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - + 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/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineUpdateHandlerTest.cs =================================================================== diff -u -re949ab20d487bf97ab1cedf2b360fdb1f948419f -r75b7759b5721edc5e0458229e2d727723f527391 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineUpdateHandlerTest.cs (.../ReferenceLineUpdateHandlerTest.cs) (revision e949ab20d487bf97ab1cedf2b360fdb1f948419f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Handlers/ReferenceLineUpdateHandlerTest.cs (.../ReferenceLineUpdateHandlerTest.cs) (revision 75b7759b5721edc5e0458229e2d727723f527391) @@ -103,7 +103,7 @@ [Test] [TestCase(true)] [TestCase(false)] - public void ConfirmReplace_ClickDialog_ReturnTrueIfOkAndFalseIfCancel(bool clickOk) + public void ConfirmUpdate_ClickDialog_ReturnTrueIfOkAndFalseIfCancel(bool clickOk) { // Setup var mocks = new MockRepository(); @@ -130,7 +130,7 @@ var handler = new ReferenceLineUpdateHandler(assessmentSection, viewCommands); // Call - bool result = handler.ConfirmReplace(); + bool result = handler.ConfirmUpdate(); // Assert Assert.AreEqual(clickOk, result); @@ -144,7 +144,7 @@ } [Test] - public void Replace_OriginalReferenceLineNull_ThrowArgumentNullException() + public void Update_OriginalReferenceLineNull_ThrowArgumentNullException() { // Setup var mocks = new MockRepository(); @@ -157,7 +157,7 @@ var referenceLine = new ReferenceLine(); // Call - TestDelegate call = () => handler.Replace(null, referenceLine); + TestDelegate call = () => handler.Update(null, referenceLine); // Assert string paramName = Assert.Throws(call).ParamName; @@ -166,7 +166,7 @@ } [Test] - public void Replace_NewReferenceLineNull_ThrowArgumentNullException() + public void Update_NewReferenceLineNull_ThrowArgumentNullException() { // Setup var mocks = new MockRepository(); @@ -179,7 +179,7 @@ var referenceLine = new ReferenceLine(); // Call - TestDelegate call = () => handler.Replace(referenceLine, null); + TestDelegate call = () => handler.Update(referenceLine, null); // Assert string paramName = Assert.Throws(call).ParamName; @@ -188,7 +188,7 @@ } [Test] - public void Replace_FullyConfiguredAssessmentSection_AllReferenceLineDependentDataCleared() + public void Update_FullyConfiguredAssessmentSection_AllReferenceLineDependentDataCleared() { // Setup var mocks = new MockRepository(); @@ -201,7 +201,7 @@ ReferenceLine referenceLine = ReferenceLineTestFactory.CreateReferenceLineWithGeometry(); // Call - IObservable[] observables = handler.Replace(assessmentSection.ReferenceLine, referenceLine).ToArray(); + IObservable[] observables = handler.Update(assessmentSection.ReferenceLine, referenceLine).ToArray(); // Assert Assert.AreEqual(59, observables.Length); @@ -366,7 +366,7 @@ } [Test] - public void DoPostReplacementUpdates_NoReplaceCalled_DoNothing() + public void DoPostUpdateActions_NoUpdateCalled_DoNothing() { // Setup var mocks = new MockRepository(); @@ -377,14 +377,14 @@ var handler = new ReferenceLineUpdateHandler(assessmentSection, viewCommands); // Call - handler.DoPostReplacementUpdates(); + handler.DoPostUpdateActions(); // Assert mocks.VerifyAll(); // Expect not calls in 'viewCommands' } [Test] - public void DoPostReplacementUpdates_AfterReplacingReferenceLine_CloseViewsForRemovedData() + public void DoPostUpdateActions_AfterUpdatingReferenceLine_CloseViewsForRemovedData() { // Setup const int expectedNumberOfRemovedInstances = 195; @@ -398,17 +398,17 @@ AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); var handler = new ReferenceLineUpdateHandler(assessmentSection, viewCommands); - handler.Replace(assessmentSection.ReferenceLine, new ReferenceLine()); + handler.Update(assessmentSection.ReferenceLine, new ReferenceLine()); // Call - handler.DoPostReplacementUpdates(); + handler.DoPostUpdateActions(); // Assert mocks.VerifyAll(); } [Test] - public void DoPostReplacementUpdates_CalledSecondTimeAfterReplaceAndUpdateCycle_DoNothing() + public void DoPostUpdateActions_CalledSecondTimeAfterUpdateAndUpdateCycle_DoNothing() { // Setup const int expectedNumberOfRemovedInstances = 195; @@ -422,11 +422,11 @@ AssessmentSection assessmentSection = TestDataGenerator.GetAssessmentSectionWithAllCalculationConfigurations(); var handler = new ReferenceLineUpdateHandler(assessmentSection, viewCommands); - handler.Replace(assessmentSection.ReferenceLine, new ReferenceLine()); - handler.DoPostReplacementUpdates(); + handler.Update(assessmentSection.ReferenceLine, new ReferenceLine()); + handler.DoPostUpdateActions(); // Call - handler.DoPostReplacementUpdates(); // Expected number should be identical to that of DoPostReplacementUpdates_AfterReplacingReferenceLine_CloseViewsForRemovedData + handler.DoPostUpdateActions(); // Expected number should be identical to that of DoPostReplacementUpdates_AfterReplacingReferenceLine_CloseViewsForRemovedData // Assert mocks.VerifyAll();