Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -rff68006e7e8f9abbb1e13617d0c99318ec07c400 -rf7cee251ae9d84968ffd3bc1451a5f22e5e2e9b8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision ff68006e7e8f9abbb1e13617d0c99318ec07c400) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationContextTreeNodeInfoTest.cs) (revision f7cee251ae9d84968ffd3bc1451a5f22e5e2e9b8) @@ -442,7 +442,7 @@ } [Test] - public void ContextMenuStrip_WithForeshoreProfileAndChanges_ContextMenuItemUpdateForeshoreProfileEnabled() + public void ContextMenuStrip_CalculationWithForeshoreProfileAndInputOutOfSync_ContextMenuItemUpdateForeshoreProfileEnabledAndToolTipSet() { // Setup var assessmentSectionStub = mocks.Stub(); @@ -482,6 +482,60 @@ } [Test] + public void GivenCalculationWithoutOutputAndWithInputOutOfSync_WhenUpdateForeshoreProfileClicked_ThenNoInquiryAndCalculationUpdatedAndInputObserverNotified() + { + // Given + var calculationObserver = mocks.StrictMock(); + var calculationInputObserver = mocks.StrictMock(); + calculationInputObserver.Expect(o => o.UpdateObserver()); + + var assessmentSectionStub = mocks.Stub(); + var failureMechanism = new TestStabilityPointStructuresFailureMechanism(); + + var calculation = new StructuresCalculation + { + InputParameters = + { + ForeshoreProfile = new TestForeshoreProfile(true) + } + }; + var nodeData = new StabilityPointStructuresCalculationContext(calculation, + failureMechanism, + assessmentSectionStub); + + calculation.Attach(calculationObserver); + calculation.InputParameters.Attach(calculationInputObserver); + + using (var treeViewControl = new TreeViewControl()) + { + var gui = mocks.Stub(); + gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); + gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub()); + mocks.ReplayAll(); + + plugin.Gui = gui; + + calculation.InputParameters.UseBreakWater = false; + + using (ContextMenuStrip contextMenuStrip = info.ContextMenuStrip(nodeData, null, treeViewControl)) + { + // Precondition + TestHelper.AssertContextMenuStripContainsItem(contextMenuStrip, + contextMenuUpdateForeshoreProfileIndex, + "&Bijwerken voorlandprofiel...", + "Berekening bijwerken met het voorlandprofiel.", + RingtoetsCommonFormsResources.UpdateItemIcon); + + // When + contextMenuStrip.Items[contextMenuUpdateForeshoreProfileIndex].PerformClick(); + + // Then + Assert.IsTrue(calculation.InputParameters.UseBreakWater); + } + } + } + + [Test] public void GivenCalculationThatSucceeds_WhenCalculatingFromContextMenu_ThenOutputSetLogMessagesAddedAndUpdateObserver() { // Given Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -rf4482775f2eb7284ee8caf72993d8688adc5907d -rf7cee251ae9d84968ffd3bc1451a5f22e5e2e9b8 --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision f4482775f2eb7284ee8caf72993d8688adc5907d) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Plugin.Test/TreeNodeInfos/StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs (.../StabilityPointStructuresCalculationGroupContextTreeNodeInfoTest.cs) (revision f7cee251ae9d84968ffd3bc1451a5f22e5e2e9b8) @@ -643,7 +643,7 @@ } [Test] - public void ContextMenuStrip_WithForeshoreProfileAndChanges_ContextMenuItemUpdateForeshoreProfilesEnabled() + public void ContextMenuStrip_CalculationGroupWithCalculationWithForeshoreProfileAndInputOutOfSync_ContextMenuItemUpdateForeshoreProfilesEnabledAndToolTipSet() { // Setup var assessmentSectionStub = mocks.Stub(); @@ -690,7 +690,7 @@ } [Test] - public void GivenCalculationWithForeshoreProfileSet_WhenUpdatingForeshoreProfileFromContextMenu_ThenCalculationUpdatedAndUpdateObserver() + public void GivenCalculationWithoutOutputAndWithInputOutOfSync_WhenUpdateForeshoreProfilesClicked_ThenNoInquiryAndCalculationUpdatedAndInputObserverNotified() { // Given var calculationObserver = mocks.StrictMock();