Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs =================================================================== diff -u -re20dff7fd605a88fa9be89b85b3a2d475c574559 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision e20dff7fd605a88fa9be89b85b3a2d475c574559) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/HydraulicLoadsStateRootContextTreeNodeInfoTest.cs (.../HydraulicLoadsStateRootContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -298,84 +298,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabled() - { - // Setup - using (var treeView = new TreeViewControl()) - { - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike); - var context = new HydraulicLoadsStateRootContext(assessmentSection); - var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - var mocks = new MockRepository(); - IGui gui = StubFactory.CreateGuiStub(mocks); - gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - mocks.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - plugin.Gui = gui; - - // Call - using (ContextMenuStrip menu = GetInfo(plugin).ContextMenuStrip(context, null, treeView)) - { - // Assert - Assert.AreEqual(10, menu.Items.Count); - - TestHelper.AssertContextMenuStripContainsItem( - menu, contextMenuCalculateAllIndex, - "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); - } - } - } - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabled() - { - // Setup - using (var treeView = new TreeViewControl()) - { - var assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) - { - HydraulicBoundaryData = - { - FilePath = "invalidFilePath" - } - }; - var context = new HydraulicLoadsStateRootContext(assessmentSection); - var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - var mocks = new MockRepository(); - IGui gui = StubFactory.CreateGuiStub(mocks); - gui.Stub(cmp => cmp.Get(context, treeView)).Return(menuBuilder); - mocks.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - plugin.Gui = gui; - - // Call - using (ContextMenuStrip menu = GetInfo(plugin).ContextMenuStrip(context, null, treeView)) - { - // Assert - Assert.AreEqual(10, menu.Items.Count); - - ToolStripItem contextMenuItem = menu.Items[contextMenuCalculateAllIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - } - - [Test] public void CanRename_Always_ReturnsTrue() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -ra30c8a08e4fc3acce66242cc6606c2b804a6ee55 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision a30c8a08e4fc3acce66242cc6606c2b804a6ee55) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -246,9 +246,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaterLevelCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle waterstanden berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -264,89 +263,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - - var nodeData = new WaterLevelCalculationsForNormTargetProbabilitiesGroupContext(new ObservableList(), - assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = gui; - - // Precondition - Assert.IsFalse(assessmentSection.HydraulicBoundaryData.IsLinked()); - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - assessmentSection.HydraulicBoundaryData.FilePath = "invalidFilePath"; - - var nodeData = new WaterLevelCalculationsForNormTargetProbabilitiesGroupContext(new ObservableList(), - assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest.cs =================================================================== diff -u -ra30c8a08e4fc3acce66242cc6606c2b804a6ee55 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest.cs) (revision a30c8a08e4fc3acce66242cc6606c2b804a6ee55) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -271,9 +271,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaterLevelCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle waterstanden berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -291,105 +290,6 @@ [Test] [TestCaseSource(typeof(WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest), nameof(GetWaterLevelForNormTargetProbabilityCalculations), new object[] { - "ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet_{0}" - })] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet( - Func> getCalculationsFunc) - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - var nodeData = new WaterLevelCalculationsForNormTargetProbabilityContext(getCalculationsFunc(assessmentSection), - assessmentSection, - () => 0.01); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - [TestCaseSource(typeof(WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest), nameof(GetWaterLevelForNormTargetProbabilityCalculations), new object[] - { - "ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet_{0}" - })] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet( - Func> getCalculationsFunc) - { - // Setup - var assessmentSection = new AssessmentSectionStub - { - HydraulicBoundaryData = - { - FilePath = "invalidFilePath", - HydraulicLocationConfigurationDatabase = - { - FilePath = "invalidFilePath" - } - } - }; - - var nodeData = new WaterLevelCalculationsForNormTargetProbabilityContext(getCalculationsFunc(assessmentSection), - assessmentSection, - () => 0.01); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - [TestCaseSource(typeof(WaterLevelCalculationsForNormTargetProbabilityContextTreeNodeInfoTest), nameof(GetWaterLevelForNormTargetProbabilityCalculations), new object[] - { "ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled_{0}" })] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled( Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r2e9f2a2a0997e4523699cceff1a5a201605709b7 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 2e9f2a2a0997e4523699cceff1a5a201605709b7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -269,9 +269,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaterLevelCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle waterstanden berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -345,97 +344,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - - var calculationsForTargetProbabilities = new ObservableList - { - new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1) - }; - - var nodeData = new WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext(calculationsForTargetProbabilities, assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = gui; - - // Precondition - Assert.IsFalse(assessmentSection.HydraulicBoundaryData.IsLinked()); - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - assessmentSection.HydraulicBoundaryData.FilePath = "invalidFilePath"; - - var calculationsForTargetProbabilities = new ObservableList - { - new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1) - }; - - var nodeData = new WaterLevelCalculationsForUserDefinedTargetProbabilitiesGroupContext(calculationsForTargetProbabilities, assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs =================================================================== diff -u -r2e9f2a2a0997e4523699cceff1a5a201605709b7 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 2e9f2a2a0997e4523699cceff1a5a201605709b7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaterLevelCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -364,9 +364,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaterLevelCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle waterstanden berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -382,92 +381,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var calculations = new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1); - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - assessmentSection.WaterLevelCalculationsForUserDefinedTargetProbabilities.Add(calculations); - - var nodeData = new WaterLevelCalculationsForUserDefinedTargetProbabilityContext(calculations, assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var calculations = new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1); - IAssessmentSection assessmentSection = new AssessmentSectionStub - { - HydraulicBoundaryData = - { - FilePath = "invalidFilePath" - } - }; - assessmentSection.WaterLevelCalculationsForUserDefinedTargetProbabilities.Add(calculations); - - var nodeData = new WaterLevelCalculationsForUserDefinedTargetProbabilityContext(calculations, assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaterLevelCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r2e9f2a2a0997e4523699cceff1a5a201605709b7 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 2e9f2a2a0997e4523699cceff1a5a201605709b7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -269,9 +269,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaveHeightCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle golfhoogten berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -345,97 +344,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - - var calculationsForTargetProbabilities = new ObservableList - { - new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1) - }; - - var nodeData = new WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext(calculationsForTargetProbabilities, assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - plugin.Gui = gui; - - // Precondition - Assert.IsFalse(assessmentSection.HydraulicBoundaryData.IsLinked()); - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaveHeightCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - assessmentSection.HydraulicBoundaryData.FilePath = "invalidFilePath"; - - var calculationsForTargetProbabilities = new ObservableList - { - new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1) - }; - - var nodeData = new WaveHeightCalculationsForUserDefinedTargetProbabilitiesGroupContext(calculationsForTargetProbabilities, assessmentSection); - - var mockRepository = new MockRepository(); - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaveHeightCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs =================================================================== diff -u -r2e9f2a2a0997e4523699cceff1a5a201605709b7 -r4edd2ecdca166fdcc25d70280861090c9e3aeecc --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 2e9f2a2a0997e4523699cceff1a5a201605709b7) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs (.../WaveHeightCalculationsForUserDefinedTargetProbabilityContextTreeNodeInfoTest.cs) (revision 4edd2ecdca166fdcc25d70280861090c9e3aeecc) @@ -326,9 +326,8 @@ TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuRunWaveHeightCalculationsIndex, "Alles be&rekenen", - "Er is geen hydraulische belastingendatabase geïmporteerd.", - RiskeerCommonFormsResources.CalculateAllIcon, - false); + "Alle golfhoogten berekenen.", + RiskeerCommonFormsResources.CalculateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuClearIllustrationPointsIndex, "Wis alle illustratiepunten...", @@ -344,92 +343,6 @@ } [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseNotLinked_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var calculations = new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1); - IAssessmentSection assessmentSection = new AssessmentSectionStub(); - assessmentSection.WaveHeightCalculationsForUserDefinedTargetProbabilities.Add(calculations); - - var nodeData = new WaveHeightCalculationsForUserDefinedTargetProbabilityContext(calculations, assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaveHeightCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Er is geen hydraulische belastingendatabase geïmporteerd.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] - public void ContextMenuStrip_HydraulicBoundaryDatabaseLinkedToInvalidFile_ContextMenuItemCalculateAllDisabledAndTooltipSet() - { - // Setup - var calculations = new HydraulicBoundaryLocationCalculationsForTargetProbability(0.1); - IAssessmentSection assessmentSection = new AssessmentSectionStub - { - HydraulicBoundaryData = - { - FilePath = "invalidFilePath" - } - }; - assessmentSection.WaveHeightCalculationsForUserDefinedTargetProbabilities.Add(calculations); - - var nodeData = new WaveHeightCalculationsForUserDefinedTargetProbabilityContext(calculations, assessmentSection); - - using (var treeViewControl = new TreeViewControl()) - { - IGui gui = StubFactory.CreateGuiStub(mockRepository); - gui.Stub(cmp => cmp.Get(nodeData, treeViewControl)).Return(new CustomItemsOnlyContextMenuBuilder()); - gui.Stub(cmp => cmp.MainWindow).Return(mockRepository.Stub()); - mockRepository.ReplayAll(); - - using (var plugin = new RiskeerPlugin()) - { - TreeNodeInfo info = GetInfo(plugin); - - plugin.Gui = gui; - - // Call - using (ContextMenuStrip contextMenu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - ToolStripItem contextMenuItem = contextMenu.Items[contextMenuRunWaveHeightCalculationsIndex]; - - Assert.AreEqual("Alles be&rekenen", contextMenuItem.Text); - StringAssert.Contains("Herstellen van de verbinding met de hydraulische belastingendatabase is mislukt.", contextMenuItem.ToolTipText); - TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.CalculateAllIcon, contextMenuItem.Image); - Assert.IsFalse(contextMenuItem.Enabled); - } - } - } - - mockRepository.VerifyAll(); // Expect no calls on arguments - } - - [Test] public void ContextMenuStrip_AllRequiredInputSet_ContextMenuItemCalculateAllEnabled() { // Setup