Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r3d902123cd368d1f304adc60bd85f4ff855b15e1 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision 3d902123cd368d1f304adc60bd85f4ff855b15e1) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresCalculationContextTreeNodeInfoTest.cs (.../ClosingStructuresCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -261,7 +261,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -866,7 +866,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); } } @@ -912,7 +912,7 @@ TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); // When Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r3d902123cd368d1f304adc60bd85f4ff855b15e1 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3d902123cd368d1f304adc60bd85f4ff855b15e1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -482,6 +482,15 @@ } /// + /// Looks up a localized string similar to Er zijn geen wijzigingen om bij te werken.. + /// + public static string CalculationItem_Update_no_changes_ToolTip { + get { + return ResourceManager.GetString("CalculationItem_Update_no_changes_ToolTip", resourceCulture); + } + } + + /// /// Looks up a localized string similar to De berekende kans van voorkomen van het berekende resultaat.. /// public static string CalculationOutput_CalculatedProbability_Description { @@ -728,7 +737,7 @@ } /// - /// Looks up a localized string similar to Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.. + /// Looks up a localized string similar to Er moet een voorlandprofiel geselecteerd zijn.. /// public static string CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_no_ForeshoreProfile_ToolTip { get { @@ -738,7 +747,7 @@ } /// - /// Looks up a localized string similar to Berekening bijwerken waar een voorlandprofiel geselecteerd is.. + /// Looks up a localized string similar to Berekening bijwerken met het voorlandprofiel.. /// public static string CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_with_ForeshoreProfile_ToolTip { get { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r3d902123cd368d1f304adc60bd85f4ff855b15e1 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 3d902123cd368d1f304adc60bd85f4ff855b15e1) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -979,11 +979,14 @@ Er zijn geen berekeningen met een kunstwerk. - Berekening bijwerken waar een voorlandprofiel geselecteerd is. + Berekening bijwerken met het voorlandprofiel. - Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken. + Er moet een voorlandprofiel geselecteerd zijn. + + Er zijn geen wijzigingen om bij te werken. + Wanneer het voorlandprofiel wijzigt als gevolg van het bijwerken, zal het resultaat van deze berekening worden verwijderd. Index: Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/TreeNodeInfos/RingtoetsContextMenuItemFactory.cs (.../RingtoetsContextMenuItemFactory.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -386,11 +386,20 @@ where TCalculationInput : ICalculationInput, IHasForeshoreProfile { TCalculationInput input = calculation.InputParameters; - bool hasForeshoreProfile = input.ForeshoreProfile != null && !input.IsForeshoreProfileInputSynchronized; - string toolTipMessage = hasForeshoreProfile - ? Resources.CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_with_ForeshoreProfile_ToolTip - : Resources.CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_no_ForeshoreProfile_ToolTip; + var isEnabled = true; + string toolTipMessage = Resources.CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_with_ForeshoreProfile_ToolTip; + if (input.ForeshoreProfile == null) + { + isEnabled = false; + toolTipMessage = Resources.CreateUpdateForshoreProfileOfCalculationItem_Update_calculation_no_ForeshoreProfile_ToolTip; + } + else if (input.IsForeshoreProfileInputSynchronized) + { + isEnabled = false; + toolTipMessage = Resources.CalculationItem_Update_no_changes_ToolTip; + } + string confirmOutputMessage = Resources.UpdateForshoreProfileOfCalculation_Confirm_calculation_output_cleared_when_updating_ForeshoreProfile_dependent_data; var menuItem = new StrictContextMenuItem( @@ -408,7 +417,7 @@ updateAction); }) { - Enabled = hasForeshoreProfile + Enabled = isEnabled }; return menuItem; Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuBuilderTest.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuBuilderTest.cs (.../RingtoetsContextMenuBuilderTest.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuBuilderTest.cs (.../RingtoetsContextMenuBuilderTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -1675,8 +1675,8 @@ TestHelper.AssertContextMenuStripContainsItem(result, 0, "&Bijwerken voorlandprofiel...", synchronized - ? "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken." - : "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + ? "Er zijn geen wijzigingen om bij te werken." + : "Berekening bijwerken met het voorlandprofiel.", RingtoetsFormsResources.UpdateItemIcon, !synchronized); } @@ -1723,7 +1723,7 @@ Assert.AreEqual(1, result.Items.Count); TestHelper.AssertContextMenuStripContainsItem(result, 0, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsFormsResources.UpdateItemIcon, false); } Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuItemFactoryTest.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuItemFactoryTest.cs (.../RingtoetsContextMenuItemFactoryTest.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/TreeNodeInfos/RingtoetsContextMenuItemFactoryTest.cs (.../RingtoetsContextMenuItemFactoryTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -615,7 +615,7 @@ // Assert Assert.AreEqual("&Bijwerken voorlandprofiel...", toolStripItem.Text); - Assert.AreEqual("Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", toolStripItem.ToolTipText); + Assert.AreEqual("Er moet een voorlandprofiel geselecteerd zijn.", toolStripItem.ToolTipText); TestHelper.AssertImagesAreEqual(RingtoetsFormsResources.UpdateItemIcon, toolStripItem.Image); Assert.IsFalse(toolStripItem.Enabled); mocks.VerifyAll(); @@ -641,7 +641,7 @@ // Assert Assert.AreEqual("&Bijwerken voorlandprofiel...", toolStripItem.Text); - Assert.AreEqual("Berekening bijwerken waar een voorlandprofiel geselecteerd is.", toolStripItem.ToolTipText); + Assert.AreEqual("Berekening bijwerken met het voorlandprofiel.", toolStripItem.ToolTipText); TestHelper.AssertImagesAreEqual(RingtoetsFormsResources.UpdateItemIcon, toolStripItem.Image); Assert.IsTrue(toolStripItem.Enabled); mocks.VerifyAll(); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -513,7 +513,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -797,7 +797,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); } } @@ -1160,7 +1160,7 @@ TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); // When Index: Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r3d902123cd368d1f304adc60bd85f4ff855b15e1 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision 3d902123cd368d1f304adc60bd85f4ff855b15e1) +++ Ringtoets/HeightStructures/test/Ringtoets.HeightStructures.Plugin.Test/TreeNodeInfos/HeightStructuresCalculationContextTreeNodeInfoTest.cs (.../HeightStructuresCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -255,7 +255,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -999,7 +999,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); } } @@ -1046,7 +1046,7 @@ TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); // When Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r3d902123cd368d1f304adc60bd85f4ff855b15e1 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision 3d902123cd368d1f304adc60bd85f4ff855b15e1) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -251,7 +251,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -475,7 +475,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); } } Index: Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/StabilityStoneCover/test/Ringtoets.StabilityStoneCover.Plugin.Test/TreeNodeInfos/StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../StabilityStoneCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -497,7 +497,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -728,6 +728,46 @@ } [Test] + public void ContextMenuStrip_WithForeshoreProfileAndChanges_ContextMenuItemUpdateForeshoreProfileEnabled() + { + // Setup + var assessmentSectionStub = mocks.Stub(); + var failureMechanism = new StabilityStoneCoverFailureMechanism(); + var calculation = new StabilityStoneCoverWaveConditionsCalculation + { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile() + } + }; + calculation.InputParameters.UseBreakWater = true; + var nodeData = new StabilityStoneCoverWaveConditionsCalculationContext(calculation, + failureMechanism, + assessmentSectionStub); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub()); + mocks.ReplayAll(); + + plugin.Gui = gui; + + // Call + using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) + { + // Assert + TestHelper.AssertContextMenuStripContainsItem(menu, + contextMenuUpdateForeshoreProfileIndex, + "&Bijwerken voorlandprofiel...", + "Berekening bijwerken met het voorlandprofiel.", + RingtoetsCommonFormsResources.UpdateItemIcon); + } + } + } + + [Test] public void GivenCalculationWithForeshoreProfileSet_WhenUpdatingForeshoreProfileFromContextMenu_ThenCalculationUpdatedAndUpdateObserver() { // Given @@ -768,7 +808,7 @@ TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); // When Index: Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r9a63dd4cf6589ffe683d8e1eb3694afced6efc78 -rff68006e7e8f9abbb1e13617d0c99318ec07c400 --- Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 9a63dd4cf6589ffe683d8e1eb3694afced6efc78) +++ Ringtoets/WaveImpactAsphaltCover/test/Ringtoets.WaveImpactAsphaltCover.Plugin.Test/TreeNodeInfos/WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../WaveImpactAsphaltCoverWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) @@ -491,7 +491,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Geselecteerd voorlandprofiel heeft geen wijzigingen om bij te werken.", + "Er moet een voorlandprofiel geselecteerd zijn.", RingtoetsCommonFormsResources.UpdateItemIcon, false); @@ -719,7 +719,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); } } @@ -1026,7 +1026,7 @@ TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, contextMenuUpdateForeshoreProfileIndex, "&Bijwerken voorlandprofiel...", - "Berekening bijwerken waar een voorlandprofiel geselecteerd is.", + "Berekening bijwerken met het voorlandprofiel.", RingtoetsCommonFormsResources.UpdateItemIcon); // When