Index: Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs =================================================================== diff -u -rf2f7d22ee59276f5df1f83fd409899bd895ea163 -r15fe8a0d6c08231dfa23bd58f84b6aa6adcba3e3 --- Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision f2f7d22ee59276f5df1f83fd409899bd895ea163) +++ Ringtoets/ClosingStructures/test/Ringtoets.ClosingStructures.Plugin.Test/TreeNodeInfos/ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs (.../ClosingStructuresFailureMechanismContextTreeNodeInfoTest.cs) (revision 15fe8a0d6c08231dfa23bd58f84b6aa6adcba3e3) @@ -23,7 +23,6 @@ using System.IO; using System.Linq; using System.Windows.Forms; -using Core.Common.Base.Geometry; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.Commands; @@ -424,57 +423,13 @@ } [Test] - public void ContextMenuStrip_NoFailureMechanismSections_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_NoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() { // Setup var guiMock = mocksRepository.StrictMock(); var failureMechanism = new ClosingStructuresFailureMechanism(); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionMock = mocksRepository.StrictMock(); - var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); - - var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); - - using (var treeViewControl = new TreeViewControl()) - { - guiMock.Expect(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); - - mocksRepository.ReplayAll(); - - plugin.Gui = guiMock; - - // Call - using (ContextMenuStrip menu = info.ContextMenuStrip(nodeData, null, treeViewControl)) - { - // Assert - TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuCalculateAllIndex, - "Alles be&rekenen", - "Er is geen vakindeling geïmporteerd.", - RingtoetsCommonFormsResources.CalculateAllIcon, - false); - - TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuValidateAllIndex, - "Alles &valideren", - "Er is geen vakindeling geïmporteerd.", - RingtoetsCommonFormsResources.ValidateAllIcon, - false); - } - } - } - - [Test] - public void ContextMenuStrip_FailureMechanismSectionsSetNoHydraulicBoundaryDatabase_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() - { - // Setup - var guiMock = mocksRepository.StrictMock(); - var failureMechanism = new ClosingStructuresFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("test", new[] - { - new Point2D(0, 0) - })); - failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionMock = mocksRepository.Stub(); var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); @@ -508,21 +463,17 @@ } [Test] - public void ContextMenuStrip_FailureMechanismSectionsSetHydraulicBoundaryDatabaseNotValid_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() + public void ContextMenuStrip_HydraulicBoundaryDatabaseNotValid_ContextMenuItemCalculateAllAndValidateAllDisabledAndTooltipSet() { // Setup var guiMock = mocksRepository.StrictMock(); var failureMechanism = new ClosingStructuresFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("test", new[] - { - new Point2D(0, 0) - })); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); - var assessmentSectionMock = mocksRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -560,10 +511,6 @@ // Setup var guiMock = mocksRepository.StrictMock(); var failureMechanism = new ClosingStructuresFailureMechanism(); - failureMechanism.AddSection(new FailureMechanismSection("test", new[] - { - new Point2D(0, 0) - })); failureMechanism.CalculationsGroup.Children.Add(new StructuresCalculation()); string validFilePath = Path.Combine(testDataPath, "complete.sqlite"); @@ -574,10 +521,10 @@ Version = "1.0" }; - var assessmentSectionMock = mocksRepository.Stub(); - assessmentSectionMock.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; + var assessmentSection = mocksRepository.Stub(); + assessmentSection.HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSectionMock); + var nodeData = new ClosingStructuresFailureMechanismContext(failureMechanism, assessmentSection); var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); using (var treeViewControl = new TreeViewControl()) @@ -614,14 +561,6 @@ var menuBuilder = new CustomItemsOnlyContextMenuBuilder(); var failureMechanism = new ClosingStructuresFailureMechanism(); - - var section = new FailureMechanismSection("A", new[] - { - new Point2D(0, 0), - new Point2D(2, 2) - }); - failureMechanism.AddSection(section); - failureMechanism.CalculationsGroup.Children.Add(new TestClosingStructuresCalculation { Name = "A", @@ -697,11 +636,6 @@ { // Setup var failureMechanism = new ClosingStructuresFailureMechanism(); - var section = new FailureMechanismSection("A", new[] - { - new Point2D(0, 0) - }); - failureMechanism.AddSection(section); failureMechanism.CalculationsGroup.Children.Add(new TestClosingStructuresCalculation { Name = "A",