Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -127,6 +127,15 @@ } /// + /// Looks up a localized string similar to &Berekening toevoegen. + /// + public static string CalculationGroup_Add_Calculation { + get { + return ResourceManager.GetString("CalculationGroup_Add_Calculation", resourceCulture); + } + } + + /// /// Looks up a localized string similar to &Map toevoegen. /// public static string CalculationGroup_Add_CalculationGroup { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -268,4 +268,7 @@ Voeg een nieuwe berekeningsmap toe aan dit faalmechanisme. + + &Berekening toevoegen + \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -61,24 +61,16 @@ } /// - /// Looks up a localized string similar to &Berekening toevoegen. + /// Looks up a localized resource of type System.Drawing.Bitmap. /// - public static string CalculationGroup_Add_GrassCoverErosionInwardsCalculation { + public static System.Drawing.Bitmap CalculationIcon { get { - return ResourceManager.GetString("CalculationGroup_Add_GrassCoverErosionInwardsCalculation", resourceCulture); + object obj = ResourceManager.GetObject("CalculationIcon", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); } } /// - /// Looks up a localized string similar to Voeg een nieuwe berekening toe aan deze berekeningsmap.. - /// - public static string CalculationGroup_Add_GrassCoverErosionInwardsCalculation_ToolTip { - get { - return ResourceManager.GetString("CalculationGroup_Add_GrassCoverErosionInwardsCalculation_ToolTip", resourceCulture); - } - } - - /// /// Looks up a localized string similar to {0} mag niet 'null' zijn.. /// public static string GrassCoverErosionInwardsContext_AssertInputsAreNotNull_DataDescription_0_cannot_be_null { @@ -116,15 +108,5 @@ "Tooltip", resourceCulture); } } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap GrassCoverErosionInwardsIcon { - get { - object obj = ResourceManager.GetObject("GrassCoverErosionInwardsIcon", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } } } Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -117,12 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - &Berekening toevoegen + + + ..\Resources\control_equalizer_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Voeg een nieuwe berekening toe aan deze berekeningsmap. - {0} mag niet 'null' zijn. @@ -135,8 +133,4 @@ Voeg een nieuwe grasbekleding erosie kruin en binnentalud berekening toe aan dit faalmechanisme. - - - ..\Resources\control_equalizer_blue.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs =================================================================== diff -u -r574777f8fe926cfb42fb0ab176f46f815a2f58b2 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision 574777f8fe926cfb42fb0ab176f46f815a2f58b2) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsGuiPlugin.cs (.../GrassCoverErosionInwardsGuiPlugin.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -51,52 +51,27 @@ namespace Ringtoets.GrassCoverErosionInwards.Plugin { /// - /// The GUI plug-in for the . + /// The GUI plug-in for the . /// public class GrassCoverErosionInwardsGuiPlugin : GuiPlugin { public override IEnumerable GetTreeNodeInfos() { - yield return new DefaultFailureMechanismTreeNodeInfo(FailureMechanismChildNodeObjects, - FailureMechanismContextMenuStrip, Gui); + yield return new DefaultFailureMechanismTreeNodeInfo( + FailureMechanismChildNodeObjects, + FailureMechanismContextMenuStrip, + Gui); yield return new TreeNodeInfo { Text = grassCoverErosionInwardsFailureMechanismContext => grassCoverErosionInwardsFailureMechanismContext.WrappedData.Name, Image = grassCoverErosionInwardsCalculationGroupContext => RingtoetsCommonFormsResources.GeneralFolderIcon, - EnsureVisibleOnCreate = grassCoverErosionInwardsCalculationGroupContext => true + EnsureVisibleOnCreate = grassCoverErosionInwardsCalculationGroupContext => true, + ChildNodeObjects = CalculationGroupContextChildNodeObjects, + ContextMenuStrip = CalculationGroupContextContextMenuStrip }; } - private object[] FailureMechanismChildNodeObjects(GrassCoverErosionInwardsFailureMechanismContext grassCoverErosionInwardsFailureMechanismContext) - { - GrassCoverErosionInwardsFailureMechanism wrappedData = grassCoverErosionInwardsFailureMechanismContext.WrappedData; - return new object[] - { - new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Inputs_DisplayName, GetInputs(wrappedData, grassCoverErosionInwardsFailureMechanismContext.Parent), TreeFolderCategory.Input), - new GrassCoverErosionInwardsCalculationGroupContext(wrappedData.CalculationsGroup, wrappedData, grassCoverErosionInwardsFailureMechanismContext.Parent), - new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Outputs_DisplayName, GetOutputs(wrappedData), TreeFolderCategory.Output) - }; - } - - private static IList GetInputs(GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) - { - return new ArrayList - { - new FailureMechanismSectionsContext(failureMechanism, assessmentSection), - new CommentContext(failureMechanism) - }; - } - - private static IList GetOutputs(GrassCoverErosionInwardsFailureMechanism failureMechanism) - { - return new ArrayList - { - new FailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism) - }; - } - private static ExceedanceProbabilityCalculationActivity CreateHydraRingTargetProbabilityCalculationActivity(HydraulicBoundaryLocation hydraulicBoundaryLocation, string hlcdDirectory, GrassCoverErosionInwardsInput inwardsInput, @@ -171,6 +146,34 @@ #region GrassCoverErosionInwards TreeNodeInfo + private object[] FailureMechanismChildNodeObjects(GrassCoverErosionInwardsFailureMechanismContext grassCoverErosionInwardsFailureMechanismContext) + { + GrassCoverErosionInwardsFailureMechanism wrappedData = grassCoverErosionInwardsFailureMechanismContext.WrappedData; + return new object[] + { + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Inputs_DisplayName, GetInputs(wrappedData, grassCoverErosionInwardsFailureMechanismContext.Parent), TreeFolderCategory.Input), + new GrassCoverErosionInwardsCalculationGroupContext(wrappedData.CalculationsGroup, wrappedData, grassCoverErosionInwardsFailureMechanismContext.Parent), + new CategoryTreeFolder(RingtoetsCommonFormsResources.FailureMechanism_Outputs_DisplayName, GetOutputs(wrappedData), TreeFolderCategory.Output) + }; + } + + private static IList GetInputs(GrassCoverErosionInwardsFailureMechanism failureMechanism, IAssessmentSection assessmentSection) + { + return new ArrayList + { + new FailureMechanismSectionsContext(failureMechanism, assessmentSection), + new CommentContext(failureMechanism) + }; + } + + private static IList GetOutputs(GrassCoverErosionInwardsFailureMechanism failureMechanism) + { + return new ArrayList + { + new FailureMechanismSectionResultContext(failureMechanism.SectionResults, failureMechanism) + }; + } + private ContextMenuStrip FailureMechanismContextMenuStrip(GrassCoverErosionInwardsFailureMechanismContext grassCoverErosionInwardsFailureMechanismContext, object parentData, TreeViewControl treeViewControl) { var addCalculationGroupItem = new StrictContextMenuItem( @@ -184,9 +187,9 @@ }; var addCalculationItem = new StrictContextMenuItem( - GrassCoverErosionInwardsFormsResources.CalculationGroup_Add_GrassCoverErosionInwardsCalculation, + RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsFailureMechanism_Add_GrassCoverErosionInwardsCalculation_Tooltip, - GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsIcon, + GrassCoverErosionInwardsFormsResources.CalculationIcon, (s, e) => AddCalculation(grassCoverErosionInwardsFailureMechanismContext.WrappedData) ) { @@ -228,5 +231,68 @@ } #endregion + + #region CalculationGroupContext TreeNodeInfo + + private static object[] CalculationGroupContextChildNodeObjects(GrassCoverErosionInwardsCalculationGroupContext nodeData) + { + var childNodeObjects = new List(); + + foreach (ICalculationBase calculationItem in nodeData.WrappedData.Children) + { + var group = calculationItem as CalculationGroup; + + if (group != null) + { + childNodeObjects.Add(new GrassCoverErosionInwardsCalculationGroupContext(group, + nodeData.GrassCoverErosionInwardsFailureMechanism, + nodeData.AssessmentSection)); + } + } + + return childNodeObjects.ToArray(); + } + + private ContextMenuStrip CalculationGroupContextContextMenuStrip(GrassCoverErosionInwardsCalculationGroupContext nodeData, object parentData, TreeViewControl treeViewControl) + { + var addCalculationGroupItem = new StrictContextMenuItem( + RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + RingtoetsCommonFormsResources.FailureMechanism_Add_CalculationGroup_Tooltip, + RingtoetsCommonFormsResources.AddFolderIcon, + (o, args) => AddCalculationGroup(nodeData.GrassCoverErosionInwardsFailureMechanism) + ) + { + Enabled = false + }; + + var addCalculationItem = new StrictContextMenuItem( + RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, + GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsFailureMechanism_Add_GrassCoverErosionInwardsCalculation_Tooltip, + GrassCoverErosionInwardsFormsResources.CalculationIcon, + (s, e) => AddCalculation(nodeData.GrassCoverErosionInwardsFailureMechanism) + ) + { + Enabled = false + }; + + var builder = Gui.Get(nodeData, treeViewControl); + + return builder + .AddOpenItem() + .AddSeparator() + .AddCustomItem(addCalculationGroupItem) + .AddCustomItem(addCalculationItem) + .AddSeparator() + .AddImportItem() + .AddExportItem() + .AddSeparator() + .AddExpandAllItem() + .AddCollapseAllItem() + .AddSeparator() + .AddPropertiesItem() + .Build(); + } + + #endregion } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj =================================================================== diff -u -r574777f8fe926cfb42fb0ab176f46f815a2f58b2 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision 574777f8fe926cfb42fb0ab176f46f815a2f58b2) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Forms.Test.csproj) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -64,7 +64,7 @@ - + Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest.cs (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -0,0 +1,260 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using System.Windows.Forms; +using Core.Common.Controls.TreeView; +using Core.Common.Gui; +using Core.Common.Gui.Commands; +using Core.Common.Gui.ContextMenu; +using Core.Common.TestUtil; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Calculation; +using Ringtoets.Common.Forms.Properties; +using Ringtoets.GrassCoverErosionInwards.Data; +using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; +using Ringtoets.GrassCoverErosionInwards.Plugin; +using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; +using RingtoetsFormsResources = Ringtoets.Common.Forms.Properties.Resources; +using GrassCoverErosionInwardsFormResources = Ringtoets.GrassCoverErosionInwards.Forms.Properties.Resources; + +namespace Ringtoets.GrassCoverErosionInwards.Forms.Test.TreeNodeInfos +{ + [TestFixture] + public class GrassCoverErosionInwardsCalculationGroupContextTreeNodeInfoTest + { + private MockRepository mocksRepository; + private GrassCoverErosionInwardsGuiPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocksRepository = new MockRepository(); + plugin = new GrassCoverErosionInwardsGuiPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(GrassCoverErosionInwardsCalculationGroupContext)); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Assert + Assert.AreEqual(typeof(GrassCoverErosionInwardsCalculationGroupContext), info.TagType); + Assert.IsNull(info.ForeColor); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + } + + [Test] + public void Text_Always_ReturnsWrappedDataName() + { + // Setup + var testname = "testName"; + var group = new CalculationGroup + { + Name = testname + }; + var failureMechanismMock = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + mocksRepository.ReplayAll(); + + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, + failureMechanismMock, + assessmentSectionMock); + + // Call + var text = info.Text(groupContext); + + // Assert + Assert.AreEqual(testname, text); + mocksRepository.VerifyAll(); + } + + [Test] + public void Image_Always_FolderIcon() + { + // Call + var image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(Resources.GeneralFolderIcon, image); + } + + [Test] + public void EnsureVisibleOnCreate_Always_ReturnsTrue() + { + // Setup + var group = new CalculationGroup(); + var failureMechanismMock = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + mocksRepository.ReplayAll(); + + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, + failureMechanismMock, + assessmentSectionMock); + + // Call + var result = info.EnsureVisibleOnCreate(groupContext); + + // Assert + Assert.IsTrue(result); + mocksRepository.VerifyAll(); + } + + [Test] + public void ChildNodeObjects_EmptyGroup_ReturnEmpty() + { + // Setup + var group = new CalculationGroup(); + var pipingFailureMechanismMock = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + mocksRepository.ReplayAll(); + + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, + pipingFailureMechanismMock, + assessmentSectionMock); + + // Call + var children = info.ChildNodeObjects(groupContext); + + // Assert + CollectionAssert.IsEmpty(children); + mocksRepository.VerifyAll(); + } + + [Test] + public void ChildNodeObjects_GroupWithMixedContents_ReturnChildren() + { + // Setup + var group = new CalculationGroup(); + var childGroup = new CalculationGroup(); + + group.Children.Add(childGroup); + + var failureMechanismMock = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + mocksRepository.ReplayAll(); + + var groupContext = new GrassCoverErosionInwardsCalculationGroupContext(group, + failureMechanismMock, + assessmentSectionMock); + + // Call + var children = info.ChildNodeObjects(groupContext); + + // Assert + Assert.AreEqual(group.Children.Count, children.Length); + var calculationContext = (GrassCoverErosionInwardsCalculationGroupContext) children[0]; + Assert.AreSame(childGroup, calculationContext.WrappedData); + } + + [Test] + public void ContextmenuStrip_Always_ReturnContextWithItems() + { + // Setup + var gui = mocksRepository.StrictMock(); + var group = new CalculationGroup(); + + var failureMechanismMock = mocksRepository.StrictMock(); + var assessmentSectionMock = mocksRepository.StrictMock(); + + var parentData = new object(); + var nodeData = new GrassCoverErosionInwardsCalculationGroupContext(group, + failureMechanismMock, + assessmentSectionMock); + + var applicationFeatureCommandHandler = mocksRepository.Stub(); + var exportImportHandler = mocksRepository.Stub(); + var viewCommandsHandler = mocksRepository.StrictMock(); + var treeViewControl = mocksRepository.StrictMock(); + + var menuBuilder = new ContextMenuBuilder(applicationFeatureCommandHandler, exportImportHandler, viewCommandsHandler, nodeData, treeViewControl); + gui.Expect(g => g.Get(nodeData, treeViewControl)).Return(menuBuilder); + + treeViewControl.Expect(tvc => tvc.CanExpandOrCollapseForData(nodeData)).Repeat.Twice().Return(false); + viewCommandsHandler.Expect(vc => vc.CanOpenViewFor(nodeData)).Return(false); + + mocksRepository.ReplayAll(); + + plugin.Gui = gui; + + // Call + ContextMenuStrip menu = info.ContextMenuStrip(nodeData, parentData, treeViewControl); + + // Assert + Assert.AreEqual(12, menu.Items.Count); + TestHelper.AssertContextMenuStripContainsItem(menu, 0, + CoreCommonGuiResources.Open, + CoreCommonGuiResources.Open_ToolTip, + CoreCommonGuiResources.OpenIcon, + false); + TestHelper.AssertContextMenuStripContainsItem(menu, 2, + RingtoetsFormsResources.CalculationGroup_Add_CalculationGroup, + "Voeg een nieuwe berekeningsmap toe aan dit faalmechanisme.", + RingtoetsFormsResources.AddFolderIcon, + false); + TestHelper.AssertContextMenuStripContainsItem(menu, 3, + RingtoetsFormsResources.CalculationGroup_Add_Calculation, + "Voeg een nieuwe grasbekleding erosie kruin en binnentalud berekening toe aan dit faalmechanisme.", + GrassCoverErosionInwardsFormResources.CalculationIcon, + false); + TestHelper.AssertContextMenuStripContainsItem(menu, 5, + CoreCommonGuiResources.Import, + CoreCommonGuiResources.Import_ToolTip, + CoreCommonGuiResources.ImportIcon, + false); + TestHelper.AssertContextMenuStripContainsItem(menu, 6, + CoreCommonGuiResources.Export, + CoreCommonGuiResources.Export_ToolTip, + CoreCommonGuiResources.ExportIcon, + false); + + TestHelper.AssertContextMenuStripContainsItem(menu, 8, + CoreCommonGuiResources.Expand_all, + CoreCommonGuiResources.Expand_all_ToolTip, + CoreCommonGuiResources.ExpandAllIcon, + false); + TestHelper.AssertContextMenuStripContainsItem(menu, 9, + CoreCommonGuiResources.Collapse_all, + CoreCommonGuiResources.Collapse_all_ToolTip, + CoreCommonGuiResources.CollapseAllIcon, + false); + + TestHelper.AssertContextMenuStripContainsItem(menu, 11, + CoreCommonGuiResources.Properties, + CoreCommonGuiResources.Properties_ToolTip, + CoreCommonGuiResources.PropertiesHS, + false); + CollectionAssert.AllItemsAreInstancesOfType(new[] + { + menu.Items[1], + menu.Items[4], + menu.Items[7], + menu.Items[10] + }, typeof(ToolStripSeparator)); + + mocksRepository.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag bbe2a3488b33585ad13bebdaa7439f5c5bbfe079 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsCalculationGroupContextTreeNodeTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismTreeNodeInfoTest.cs =================================================================== diff -u -r574777f8fe926cfb42fb0ab176f46f815a2f58b2 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismTreeNodeInfoTest.cs) (revision 574777f8fe926cfb42fb0ab176f46f815a2f58b2) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Forms.Test/TreeNodeInfos/GrassCoverErosionInwardsFailureMechanismTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsFailureMechanismTreeNodeInfoTest.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -34,6 +34,7 @@ using Ringtoets.GrassCoverErosionInwards.Forms.PresentationObjects; using Ringtoets.GrassCoverErosionInwards.Forms.Properties; using Ringtoets.GrassCoverErosionInwards.Plugin; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.GrassCoverErosionInwards.Forms.Test.TreeNodeInfos { @@ -98,7 +99,7 @@ var image = info.Image(null); // Assert - TestHelper.AssertImagesAreEqual(Resources.GrassCoverErosionInwardsIcon, image); + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.FailureMechanismIcon, image); } [Test] Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/FailureMechanismSectionsImporter.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/FailureMechanismSectionsImporter.cs (.../FailureMechanismSectionsImporter.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/FileImporters/FailureMechanismSectionsImporter.cs (.../FailureMechanismSectionsImporter.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -10,7 +10,6 @@ using log4net; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.PresentationObjects; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs =================================================================== diff -u -rfc38d18fc6ff1749476da0ea43281d5d80568283 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision fc38d18fc6ff1749476da0ea43281d5d80568283) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/FailureMechanismSectionsContextTreeNodeInfoTest.cs (.../FailureMechanismSectionsContextTreeNodeInfoTest.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -11,7 +11,6 @@ using Rhino.Mocks; -using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Forms.PresentationObjects; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -595,15 +595,6 @@ } /// - /// Looks up a localized string similar to &Berekening toevoegen. - /// - public static string PipingCalculationGroup_Add_PipingCalculation { - get { - return ResourceManager.GetString("PipingCalculationGroup_Add_PipingCalculation", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Voeg een nieuwe berekening toe aan deze berekeningsmap.. /// public static string PipingCalculationGroup_Add_PipingCalculation_ToolTip { Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/Properties/Resources.resx (.../Resources.resx) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -349,9 +349,6 @@ Ondergrondschematisatie - - &Berekening toevoegen - Voeg een nieuwe piping berekening toe aan dit faalmechanisme. Index: Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs =================================================================== diff -u -r073f4371610f4964a1f877737184494a684f7610 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision 073f4371610f4964a1f877737184494a684f7610) +++ Ringtoets/Piping/src/Ringtoets.Piping.Plugin/PipingGuiPlugin.cs (.../PipingGuiPlugin.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -291,7 +291,7 @@ ); var addCalculationItem = new StrictContextMenuItem( - PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, + RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, PipingFormsResources.PipingFailureMechanism_Add_PipingCalculation_Tooltip, PipingFormsResources.PipingIcon, (s, e) => AddCalculation(pipingFailureMechanismContext.WrappedData) @@ -615,7 +615,7 @@ }); var addCalculationItem = new StrictContextMenuItem( - PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, + RingtoetsCommonFormsResources.CalculationGroup_Add_Calculation, PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation_ToolTip, PipingFormsResources.PipingIcon, (o, args) => { Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r574777f8fe926cfb42fb0ab176f46f815a2f58b2 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision 574777f8fe926cfb42fb0ab176f46f815a2f58b2) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingCalculationGroupContextTreeNodeInfoTest.cs (.../PipingCalculationGroupContextTreeNodeInfoTest.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -47,7 +47,6 @@ using RingtoetsFormsResources = Ringtoets.Common.Forms.Properties.Resources; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; -using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Piping.Forms.Test.TreeNodeInfos { @@ -112,7 +111,7 @@ var image = info.Image(null); // Assert - TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + TestHelper.AssertImagesAreEqual(RingtoetsFormsResources.GeneralFolderIcon, image); } [Test] @@ -258,11 +257,11 @@ // Assert Assert.AreEqual(17, menu.Items.Count); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndex, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + RingtoetsFormsResources.CalculationGroup_Add_CalculationGroup, "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", - RingtoetsCommonFormsResources.AddFolderIcon); + RingtoetsFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndex, - PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, + RingtoetsFormsResources.CalculationGroup_Add_Calculation, "Voeg een nieuwe berekening toe aan deze berekeningsmap.", PipingFormsResources.PipingIcon); @@ -370,11 +369,11 @@ // Assert Assert.AreEqual(16, menu.Items.Count); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndex, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + RingtoetsFormsResources.CalculationGroup_Add_CalculationGroup, "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", - RingtoetsCommonFormsResources.AddFolderIcon); + RingtoetsFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndex, - PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, + RingtoetsFormsResources.CalculationGroup_Add_Calculation, "Voeg een nieuwe berekening toe aan deze berekeningsmap.", PipingFormsResources.PipingIcon); @@ -477,11 +476,11 @@ var mainCalculationGroupContextMenuItemOffset = 4; Assert.AreEqual(18, menu.Items.Count); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationGroupIndex + mainCalculationGroupContextMenuItemOffset, - RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, + RingtoetsFormsResources.CalculationGroup_Add_CalculationGroup, "Voeg een nieuwe berekeningsmap toe aan deze berekeningsmap.", - RingtoetsCommonFormsResources.AddFolderIcon); + RingtoetsFormsResources.AddFolderIcon); TestHelper.AssertContextMenuStripContainsItem(menu, contextMenuAddCalculationIndex + mainCalculationGroupContextMenuItemOffset, - PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, + RingtoetsFormsResources.CalculationGroup_Add_Calculation, "Voeg een nieuwe berekening toe aan deze berekeningsmap.", PipingFormsResources.PipingIcon); Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismTreeNodeInfoTest.cs =================================================================== diff -u -rabb2667229e96d5b8158981c890a5c7046e9ca66 -rbbe2a3488b33585ad13bebdaa7439f5c5bbfe079 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismTreeNodeInfoTest.cs (.../PipingFailureMechanismTreeNodeInfoTest.cs) (revision abb2667229e96d5b8158981c890a5c7046e9ca66) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TreeNodeInfos/PipingFailureMechanismTreeNodeInfoTest.cs (.../PipingFailureMechanismTreeNodeInfoTest.cs) (revision bbe2a3488b33585ad13bebdaa7439f5c5bbfe079) @@ -292,7 +292,7 @@ TestHelper.AssertContextMenuStripContainsItem(menu, 0, CoreCommonGuiResources.Open, CoreCommonGuiResources.Open_ToolTip, CoreCommonGuiResources.OpenIcon, false); TestHelper.AssertContextMenuStripContainsItem(menu, 2, RingtoetsCommonFormsResources.CalculationGroup_Add_CalculationGroup, RingtoetsCommonFormsResources.FailureMechanism_Add_CalculationGroup_Tooltip, RingtoetsCommonFormsResources.AddFolderIcon); - TestHelper.AssertContextMenuStripContainsItem(menu, 3, PipingFormsResources.PipingCalculationGroup_Add_PipingCalculation, PipingFormsResources.PipingFailureMechanism_Add_PipingCalculation_Tooltip, PipingFormsResources.PipingIcon); + TestHelper.AssertContextMenuStripContainsItem(menu, 3, RingtoetsFormsResources.CalculationGroup_Add_Calculation, PipingFormsResources.PipingFailureMechanism_Add_PipingCalculation_Tooltip, PipingFormsResources.PipingIcon); TestHelper.AssertContextMenuStripContainsItem(menu, 5, RingtoetsFormsResources.Validate_all, RingtoetsFormsResources.Validate_all_ToolTip, RingtoetsFormsResources.ValidateAllIcon); TestHelper.AssertContextMenuStripContainsItem(menu, 6, RingtoetsFormsResources.Calculate_all, RingtoetsFormsResources.Calculate_all_ToolTip, RingtoetsFormsResources.CalculateAllIcon);