Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -r2ddb550138698d672f34991ff4b325115355cd19 -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 2ddb550138698d672f34991ff4b325115355cd19) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -604,7 +604,6 @@ }); SetHydraulicsMenuItemEnabledStateAndTooltip(nodeData.AssessmentSection, - nodeData.FailureMechanism, nodeData.GetNormFunc(), designWaterLevelItem); @@ -647,7 +646,6 @@ }); SetHydraulicsMenuItemEnabledStateAndTooltip(nodeData.AssessmentSection, - nodeData.FailureMechanism, nodeData.GetNormFunc(), waveHeightItem); @@ -851,16 +849,11 @@ private static string ValidateAllDataAvailableAndGetErrorMessage(GrassCoverErosionOutwardsWaveConditionsCalculationGroupContext context) { - return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection, context.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection); } - private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection, IFailureMechanism failureMechanism) + private static string ValidateAllDataAvailableAndGetErrorMessage(IAssessmentSection assessmentSection) { - if (failureMechanism.Contribution <= 0.0) - { - return RingtoetsCommonFormsResources.Contribution_of_failure_mechanism_zero; - } - return HydraulicBoundaryDatabaseConnectionValidator.Validate(assessmentSection.HydraulicBoundaryDatabase); } @@ -970,7 +963,7 @@ private static string ValidateAllDataAvailableAndGetErrorMessage(GrassCoverErosionOutwardsWaveConditionsCalculationContext context) { - return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection, context.FailureMechanism); + return ValidateAllDataAvailableAndGetErrorMessage(context.AssessmentSection); } private static void Validate(GrassCoverErosionOutwardsWaveConditionsCalculationContext context) @@ -1047,7 +1040,7 @@ ActivityProgressDialogRunner.Run(Gui.MainWindow, activities); }); - SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, nodeData.FailureMechanism, designWaterLevelItem); + SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, designWaterLevelItem); return Gui.Get(nodeData, treeViewControl) .AddCustomItem(designWaterLevelItem) @@ -1128,7 +1121,7 @@ ActivityProgressDialogRunner.Run(Gui.MainWindow, activities); }); - SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, nodeData.FailureMechanism, waveHeightItem); + SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, waveHeightItem); return Gui.Get(nodeData, treeViewControl) .AddCustomItem(waveHeightItem) @@ -1178,10 +1171,9 @@ #endregion private static void SetHydraulicsMenuItemEnabledStateAndTooltip(IAssessmentSection assessmentSection, - IFailureMechanism failureMechanism, StrictContextMenuItem menuItem) { - string validationText = ValidateAllDataAvailableAndGetErrorMessage(assessmentSection, failureMechanism); + string validationText = ValidateAllDataAvailableAndGetErrorMessage(assessmentSection); if (!string.IsNullOrEmpty(validationText)) { menuItem.Enabled = false; @@ -1190,11 +1182,10 @@ } private static void SetHydraulicsMenuItemEnabledStateAndTooltip(IAssessmentSection assessmentSection, - IFailureMechanism failureMechanism, double norm, StrictContextMenuItem menuItem) { - SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, failureMechanism, menuItem); + SetHydraulicsMenuItemEnabledStateAndTooltip(assessmentSection, menuItem); if (!menuItem.Enabled) { return; Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r81c5a3672b67abf1568a33f3f5b1717a5d866dfe -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsContextTreeNodeInfoTest.cs) (revision 81c5a3672b67abf1568a33f3f5b1717a5d866dfe) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -150,7 +150,7 @@ public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup - var assessmentSection = mockRepository.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); using (var treeViewControl = new TreeViewControl()) using (var plugin = new GrassCoverErosionOutwardsPlugin()) @@ -250,68 +250,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var assessmentSection = mockRepository.Stub(); - var applicationFeatureCommandHandler = mockRepository.Stub(); - var importCommandHandler = mockRepository.Stub(); - var exportCommandHandler = mockRepository.Stub(); - var updateCommandHandler = mockRepository.Stub(); - var viewCommandsHandler = mockRepository.Stub(); - - viewCommandsHandler.Stub(vch => vch.CanOpenViewFor(null)).IgnoreArguments().Return(true); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "HydraulicBoundaryDatabaseImporter"), "complete.sqlite"), - Version = "1.0" - }); - - using (var treeViewControl = new TreeViewControl()) - { - using (var plugin = new GrassCoverErosionOutwardsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - var context = new GrassCoverErosionOutwardsDesignWaterLevelCalculationsContext(new ObservableList(), - new GrassCoverErosionOutwardsFailureMechanism(), - assessmentSection, - () => 0.01, - "A"); - - var menuBuilder = new ContextMenuBuilder(applicationFeatureCommandHandler, - importCommandHandler, - exportCommandHandler, - updateCommandHandler, - viewCommandsHandler, - context, - treeViewControl); - - var gui = mockRepository.Stub(); - gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); - - mockRepository.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, - contextMenuRunDesignWaterLevelCalculationsIndex, - "Alles be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - } - } - } - - mockRepository.VerifyAll(); - } - - [Test] public void ContextMenuStrip_InvalidNorm_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r34b41b7c2a23389f88d686f26e6e8e90fbdd645a -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs) (revision 34b41b7c2a23389f88d686f26e6e8e90fbdd645a) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -254,47 +254,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var mockRepository = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); - - var context = new GrassCoverErosionOutwardsDesignWaterLevelCalculationsGroupContext(new ObservableList(), - new GrassCoverErosionOutwardsFailureMechanism(), - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var gui = mockRepository.Stub(); - gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new GrassCoverErosionOutwardsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = gui; - plugin.Activate(); - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, - contextMenuRunDesignWaterLevelCalculationsIndex, - "Alles be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - } - } - } - - mockRepository.VerifyAll(); - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs =================================================================== diff -u -r412c54c9a315e683f0cd733409f44b5b8c9d8507 -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 412c54c9a315e683f0cd733409f44b5b8c9d8507) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -429,7 +429,7 @@ { // Setup var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); + var assessmentSection = new AssessmentSectionStub(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); @@ -659,66 +659,6 @@ } [Test] - public void GivenFailureMechanismContributionZero_ThenValidationItemDisabled() - { - // Given - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 0 - }; - - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath - }); - - var parent = new CalculationGroup(); - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation - { - Name = "A" - }; - var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - parent, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var updateHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilder = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - updateHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilder); - gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub()); - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Then - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - validateMenuItemIndex, - "&Valideren", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.ValidateIcon, - false); - } - } - } - - [Test] public void GivenValidInput_ThenValidationItemEnabled() { // Given @@ -777,7 +717,7 @@ public void ContextMenuStrip_CalculationWithoutForeshoreProfile_ContextMenuItemUpdateForeshoreProfileDisabledAndToolTipSet() { // Setup - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation(); @@ -815,7 +755,7 @@ public void ContextMenuStrip_CalculationWithForeshoreProfileAndInputInSync_ContextMenuItemUpdateForeshoreProfileDisabledAndToolTipSet() { // Setup - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation @@ -859,7 +799,7 @@ public void ContextMenuStrip_CalculationWithForeshoreProfileAndInputOutSync_ContextMenuItemUpdateForeshoreProfileEnabledAndToolTipSet() { // Setup - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var foreshoreProfileInput = new TestForeshoreProfile(); @@ -909,7 +849,7 @@ var calculationInputObserver = mocks.StrictMock(); calculationInputObserver.Expect(o => o.UpdateObserver()); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var foreshoreProfileInput = new TestForeshoreProfile(true); @@ -962,7 +902,7 @@ // Given var calculationObserver = mocks.StrictMock(); var calculationInputObserver = mocks.StrictMock(); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); var foreshoreProfileInput = new TestForeshoreProfile(true); @@ -1488,66 +1428,6 @@ } [Test] - public void GivenFailureMechanismContributionZero_ThenCalculationItemDisabled() - { - // Given - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 0 - }; - - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validFilePath - }); - - var parent = new CalculationGroup(); - var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation - { - Name = "A" - }; - var context = new GrassCoverErosionOutwardsWaveConditionsCalculationContext(calculation, - parent, - failureMechanism, - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var appFeatureCommandHandler = mocks.Stub(); - var importHandler = mocks.Stub(); - var exportHandler = mocks.Stub(); - var updateHandler = mocks.Stub(); - var viewCommands = mocks.Stub(); - var menuBuilder = new ContextMenuBuilder(appFeatureCommandHandler, - importHandler, - exportHandler, - updateHandler, - viewCommands, - context, - treeViewControl); - - var gui = mocks.Stub(); - gui.Stub(g => g.Get(context, treeViewControl)).Return(menuBuilder); - gui.Stub(cmp => cmp.MainWindow).Return(mocks.Stub()); - mocks.ReplayAll(); - - plugin.Gui = gui; - - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Then - TestHelper.AssertContextMenuStripContainsItem(contextMenu, - calculateMenuItemIndex, - "Be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateIcon, - false); - } - } - } - - [Test] public void GivenValidInput_ThenCalculationItemEnabled() { // Given @@ -1735,7 +1615,7 @@ { // Given var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var parent = new CalculationGroup(); var calculation = new GrassCoverErosionOutwardsWaveConditionsCalculation @@ -1787,7 +1667,7 @@ { // Given var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism(); - var assessmentSection = mocks.Stub(); + IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mocks); var observer = mocks.Stub(); observer.Expect(o => o.UpdateObserver()); Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r34b41b7c2a23389f88d686f26e6e8e90fbdd645a -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 34b41b7c2a23389f88d686f26e6e8e90fbdd645a) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveConditionsCalculationGroupContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -787,62 +787,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_CalculateAllAndValidateAllDisabled() - { - // Setup - string validHydraulicBoundaryDatabasePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, - Path.Combine("HydraulicBoundaryDatabaseImporter", "complete.sqlite")); - - using (var treeViewControl = new TreeViewControl()) - { - var group = new CalculationGroup(); - group.Children.Add(new GrassCoverErosionOutwardsWaveConditionsCalculation()); - - var failureMechanism = new GrassCoverErosionOutwardsFailureMechanism - { - Contribution = 0 - }; - failureMechanism.WaveConditionsCalculationGroup.Children.Add(group); - - var assessmentSection = mocks.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = validHydraulicBoundaryDatabasePath - }); - - var nodeData = new GrassCoverErosionOutwardsWaveConditionsCalculationGroupContext(group, - failureMechanism.WaveConditionsCalculationGroup, - failureMechanism, - assessmentSection); - var parentNodeData = new GrassCoverErosionOutwardsWaveConditionsCalculationGroupContext(failureMechanism.WaveConditionsCalculationGroup, - null, - failureMechanism, - assessmentSection); - - var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - gui.Stub(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); - gui.Stub(g => g.MainWindow).Return(mocks.Stub()); - mocks.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, parentNodeData, treeViewControl)) - { - // Assert - ToolStripItem validateItem = contextMenu.Items[contextMenuValidateAllIndexNestedGroup]; - ToolStripItem calculateItem = contextMenu.Items[contextMenuCalculateAllIndexNestedGroup]; - Assert.IsFalse(validateItem.Enabled); - Assert.IsFalse(calculateItem.Enabled); - const string message = "De bijdrage van dit toetsspoor is nul."; - Assert.AreEqual(message, calculateItem.ToolTipText); - Assert.AreEqual(message, validateItem.ToolTipText); - } - } - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_CalculateAllAndValidateAllEnabled() { // Setup Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r81c5a3672b67abf1568a33f3f5b1717a5d866dfe -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightCalculationsContextTreeNodeInfoTest.cs) (revision 81c5a3672b67abf1568a33f3f5b1717a5d866dfe) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightCalculationsContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -144,7 +144,7 @@ public void ContextMenuStrip_Always_CallsContextMenuBuilderMethods() { // Setup - var assessmentSection = mockRepository.Stub(); + var assessmentSection = new AssessmentSectionStub(); using (var treeViewControl = new TreeViewControl()) { @@ -241,66 +241,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var assessmentSection = mockRepository.Stub(); - assessmentSection.Stub(a => a.HydraulicBoundaryDatabase).Return(new HydraulicBoundaryDatabase - { - FilePath = Path.Combine(TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Common.IO, "HydraulicBoundaryDatabaseImporter"), "complete.sqlite"), - Version = "1.0" - }); - - var applicationFeatureCommandHandler = mockRepository.Stub(); - var importCommandHandler = mockRepository.Stub(); - var exportCommandHandler = mockRepository.Stub(); - var updateCommandHandler = mockRepository.Stub(); - var viewCommandsHandler = mockRepository.Stub(); - viewCommandsHandler.Stub(vch => vch.CanOpenViewFor(null)).IgnoreArguments().Return(true); - - using (var treeViewControl = new TreeViewControl()) - { - using (var plugin = new GrassCoverErosionOutwardsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - var context = new GrassCoverErosionOutwardsWaveHeightCalculationsContext(new ObservableList(), - new GrassCoverErosionOutwardsFailureMechanism(), - assessmentSection, () => 0.1, "Test"); - - var menuBuilder = new ContextMenuBuilder(applicationFeatureCommandHandler, - importCommandHandler, - exportCommandHandler, - updateCommandHandler, - viewCommandsHandler, - context, - treeViewControl); - - var gui = mockRepository.Stub(); - gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(menuBuilder); - - mockRepository.ReplayAll(); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, - contextMenuRunWaveHeightCalculationsIndex, - "Alles be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - } - } - } - - mockRepository.VerifyAll(); - } - - [Test] public void ContextMenuStrip_InvalidNorm_ContextMenuItemCalculateAllDisabledAndTooltipSet() { // Setup Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r34b41b7c2a23389f88d686f26e6e8e90fbdd645a -r4278b8ff350cb0c4629c8609e2b8267af9f5da5b --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightCalculationsGroupContextTreeNodeInfoTest.cs) (revision 34b41b7c2a23389f88d686f26e6e8e90fbdd645a) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionOutwardsWaveHeightCalculationsGroupContextTreeNodeInfoTest.cs (.../GrassCoverErosionOutwardsWaveHeightCalculationsGroupContextTreeNodeInfoTest.cs) (revision 4278b8ff350cb0c4629c8609e2b8267af9f5da5b) @@ -254,47 +254,6 @@ } [Test] - public void ContextMenuStrip_FailureMechanismContributionZero_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var mockRepository = new MockRepository(); - IAssessmentSection assessmentSection = AssessmentSectionHelper.CreateAssessmentSectionStub(mockRepository); - - var context = new GrassCoverErosionOutwardsWaveHeightCalculationsGroupContext(new ObservableList(), - new GrassCoverErosionOutwardsFailureMechanism(), - assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - var gui = mockRepository.Stub(); - gui.Stub(cmp => cmp.Get(context, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(g => g.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new GrassCoverErosionOutwardsPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = gui; - plugin.Activate(); - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(context, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, - contextMenuRunWaveHeightCalculationsIndex, - "Alles be&rekenen", - "De bijdrage van dit toetsspoor is nul.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - } - } - } - - mockRepository.VerifyAll(); - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup