Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.Designer.cs =================================================================== diff -u -re365eaae0adcd51e52542b0dc80b8912d0c13037 -rae3a814fe551ccb267577cca11f1cc8d136f1dba --- Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision e365eaae0adcd51e52542b0dc80b8912d0c13037) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision ae3a814fe551ccb267577cca11f1cc8d136f1dba) @@ -1,25 +1,4 @@ -// Copyright (C) Stichting Deltares 2021. All rights reserved. -// -// This file is part of Riskeer. -// -// Riskeer 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. - -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -82,6 +61,15 @@ } /// + /// Looks up a localized string similar to Duidingsklassen. + /// + public static string AssemblyGroups_DisplayName { + get { + return ResourceManager.GetString("AssemblyGroups_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to gml. /// public static string AssemblyResult_file_filter_Extension { Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.resx =================================================================== diff -u -re365eaae0adcd51e52542b0dc80b8912d0c13037 -rae3a814fe551ccb267577cca11f1cc8d136f1dba --- Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision e365eaae0adcd51e52542b0dc80b8912d0c13037) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/Properties/Resources.resx (.../Resources.resx) (revision ae3a814fe551ccb267577cca11f1cc8d136f1dba) @@ -59,7 +59,8 @@ : using a System.ComponentModel.TypeConverter : and then encoded with base64 encoding. --> - @@ -140,7 +141,8 @@ Wilt u doorgaan? - + De resultaten van {0} semi-probabilistische berekeningen zonder handmatige waterstand zijn verwijderd. Hydraulische belastingen zijn samengevoegd. + xml:space="preserve"> Gegevens van het generieke faalpad '{0}' zijn vervangen. Het traject kan niet aangemaakt worden met een ondergrens van {0} en een signaleringswaarde van {1}. De waarde van de ondergrens en signaleringswaarde moet in het bereik {2} liggen en de ondergrens moet gelijk zijn aan of groter zijn dan de signaleringswaarde. - + Als u de norm aanpast, dan worden de rekenresultaten van semi-probabilistische berekeningen zonder handmatig toetspeil verwijderd. Weet u zeker dat u wilt doorgaan? - + Als u de norm aanpast, dan worden de rekenresultaten van alle hydraulische belastingenlocaties behorende bij deze norm en semi-probabilistische berekeningen zonder handmatig toetspeil verwijderd. Weet u zeker dat u wilt doorgaan? - + Als u de norm aanpast, dan worden de rekenresultaten van alle hydraulische belastingenlocaties behorende bij deze norm verwijderd. Weet u zeker dat u wilt doorgaan? @@ -319,4 +324,7 @@ Faalpad '{0}' en de bijbehorende gegevens zijn toegevoegd aan de lijst van specifieke faalpaden. + + Duidingsklassen + \ No newline at end of file Index: Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs =================================================================== diff -u -r3d6d40241eb27b32fa9dfcff845bb9d9a6139367 -rae3a814fe551ccb267577cca11f1cc8d136f1dba --- Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision 3d6d40241eb27b32fa9dfcff845bb9d9a6139367) +++ Riskeer/Integration/src/Riskeer.Integration.Plugin/RiskeerPlugin.cs (.../RiskeerPlugin.cs) (revision ae3a814fe551ccb267577cca11f1cc8d136f1dba) @@ -787,7 +787,14 @@ yield return CreateSpecificFailurePathTreeNodeInfo(); - yield return new TreeNodeInfo(); + yield return new TreeNodeInfo + { + Text = context => Resources.AssemblyGroups_DisplayName, + Image = context => RiskeerCommonFormsResources.NormsIcon, + ContextMenuStrip = (nodeData, parentData, treeViewControl) => Gui.Get(nodeData, treeViewControl) + .AddOpenItem() + .Build() + }; yield return new TreeNodeInfo { @@ -1806,6 +1813,7 @@ return new object[] { + new AssemblyGroupsContext(assessmentSection), new GenericFailurePathsContext(assessmentSection), new SpecificFailurePathsContext(assessmentSection.SpecificFailurePaths, assessmentSection), new AssemblyResultsContext(assessmentSection) Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyGroupsContextTreeNodeInfoTest.cs =================================================================== diff -u --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyGroupsContextTreeNodeInfoTest.cs (revision 0) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/AssemblyGroupsContextTreeNodeInfoTest.cs (revision ae3a814fe551ccb267577cca11f1cc8d136f1dba) @@ -0,0 +1,125 @@ +// Copyright (C) Stichting Deltares 2021. All rights reserved. +// +// This file is part of Riskeer. +// +// Riskeer 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.Drawing; +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.TestUtil; +using Core.Gui; +using Core.Gui.ContextMenu; +using NUnit.Framework; +using Rhino.Mocks; +using Riskeer.Common.Plugin.TestUtil; +using Riskeer.Integration.Forms.PresentationObjects; +using RiskeerCommonFormsResources = Riskeer.Common.Forms.Properties.Resources; + +namespace Riskeer.Integration.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class AssemblyGroupsContextTreeNodeInfoTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RiskeerPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNotNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + } + } + + [Test] + public void Text_Always_ReturnsName() + { + // Setup + using (var plugin = new RiskeerPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + string text = info.Text(null); + + // Assert + Assert.AreEqual("Duidingsklassen", text); + } + } + + [Test] + public void Image_Always_ReturnsSetImage() + { + // Setup + using (var plugin = new RiskeerPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Image image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(RiskeerCommonFormsResources.NormsIcon, image); + } + } + + [Test] + public void ContextMenuStrip_Always_CallsBuilder() + { + // Setup + var mocks = new MockRepository(); + var menuBuilder = mocks.StrictMock(); + using (mocks.Ordered()) + { + menuBuilder.Expect(mb => mb.AddOpenItem()).Return(menuBuilder); + menuBuilder.Expect(mb => mb.Build()).Return(null); + } + + using (var treeViewControl = new TreeViewControl()) + { + IGui gui = StubFactory.CreateGuiStub(mocks); + gui.Stub(g => g.Get(null, treeViewControl)).Return(menuBuilder); + mocks.ReplayAll(); + + using (var plugin = new RiskeerPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + plugin.Gui = gui; + + // Call + info.ContextMenuStrip(null, null, treeViewControl); + } + } + + // Assert + mocks.VerifyAll(); + } + + private static TreeNodeInfo GetInfo(RiskeerPlugin plugin) + { + return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(AssemblyGroupsContext)); + } + } +} \ No newline at end of file Index: Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs =================================================================== diff -u -rfef746e0bcda42b11c60506b0032eee20e48175f -rae3a814fe551ccb267577cca11f1cc8d136f1dba --- Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs (.../FailurePathsStateRootContextTreeNodeInfoTest.cs) (revision fef746e0bcda42b11c60506b0032eee20e48175f) +++ Riskeer/Integration/test/Riskeer.Integration.Plugin.Test/TreeNodeInfos/FailurePathsStateRootContextTreeNodeInfoTest.cs (.../FailurePathsStateRootContextTreeNodeInfoTest.cs) (revision ae3a814fe551ccb267577cca11f1cc8d136f1dba) @@ -155,16 +155,19 @@ object[] objects = info.ChildNodeObjects(context).ToArray(); // Assert - Assert.AreEqual(3, objects.Length); + Assert.AreEqual(4, objects.Length); - var genericFailurePathsContext = (GenericFailurePathsContext) objects[0]; + var assemblyGroupsContext = (AssemblyGroupsContext) objects[0]; + Assert.AreSame(assessmentSection, assemblyGroupsContext.WrappedData); + + var genericFailurePathsContext = (GenericFailurePathsContext) objects[1]; Assert.AreSame(assessmentSection, genericFailurePathsContext.WrappedData); - var specificFailurePathsContext = (SpecificFailurePathsContext) objects[1]; + var specificFailurePathsContext = (SpecificFailurePathsContext) objects[2]; Assert.AreSame(assessmentSection.SpecificFailurePaths, specificFailurePathsContext.WrappedData); Assert.AreSame(assessmentSection, specificFailurePathsContext.AssessmentSection); - var assemblyResultsContext = (AssemblyResultsContext) objects[2]; + var assemblyResultsContext = (AssemblyResultsContext) objects[3]; Assert.AreSame(assessmentSection, assemblyResultsContext.WrappedData); } }