Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r9d5f42a34e94425c8a21ba8fcf0e33b41b78ff69 -r53bfde12ab449eba06567e6ff64627faec1d8026 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 9d5f42a34e94425c8a21ba8fcf0e33b41b78ff69) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -709,17 +709,29 @@ ContextMenuStrip = HydraulicBoundaryDatabaseContextMenuStrip }; + yield return new TreeNodeInfo + { + Text = context => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName, + Image = context => RingtoetsCommonFormsResources.GeneralFolderIcon + }; + yield return new TreeNodeInfo { - Text = designWaterLevel => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName, - Image = designWaterLevel => RingtoetsCommonFormsResources.GeneralFolderIcon, + Text = context => RingtoetsFormsResources.DesignWaterLevelLocationsContext_DisplayName, + Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, ContextMenuStrip = DesignWaterLevelLocationsContextMenuStrip }; + yield return new TreeNodeInfo + { + Text = context => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName, + Image = context => RingtoetsCommonFormsResources.GeneralFolderIcon + }; + yield return new TreeNodeInfo { - Text = waveHeight => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName, - Image = waveHeight => RingtoetsCommonFormsResources.GeneralFolderIcon, + Text = context => RingtoetsFormsResources.WaveHeightLocationsContext_DisplayName, + Image = context => RingtoetsCommonFormsResources.GenericInputOutputIcon, ContextMenuStrip = WaveHeightLocationsContextMenuStrip }; Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj =================================================================== diff -u -r1f615259511682f345362553663378b62fcd2842 -r53bfde12ab449eba06567e6ff64627faec1d8026 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 1f615259511682f345362553663378b62fcd2842) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/Ringtoets.Integration.Plugin.Test.csproj (.../Ringtoets.Integration.Plugin.Test.csproj) (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -68,6 +68,7 @@ + @@ -89,6 +90,7 @@ + Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r1f615259511682f345362553663378b62fcd2842 -r53bfde12ab449eba06567e6ff64627faec1d8026 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 1f615259511682f345362553663378b62fcd2842) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -476,7 +476,7 @@ TreeNodeInfo[] treeNodeInfos = plugin.GetTreeNodeInfos().ToArray(); // Assert - Assert.AreEqual(27, treeNodeInfos.Length); + Assert.AreEqual(29, treeNodeInfos.Length); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(AssessmentSection))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(BackgroundData))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ReferenceLineContext))); @@ -488,7 +488,9 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(FailureMechanismContributionContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(HydraulicBoundaryDatabaseContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(DesignWaterLevelLocationsContext))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(DesignWaterLevelLocationsGroupContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveHeightLocationsContext))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(WaveHeightLocationsGroupContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ForeshoreProfilesContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(DikeProfile))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(ForeshoreProfile))); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r0b1d32f7e945fcf7ba1f9fdaeebb61765af3f7b0 -r53bfde12ab449eba06567e6ff64627faec1d8026 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 0b1d32f7e945fcf7ba1f9fdaeebb61765af3f7b0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -105,7 +105,7 @@ } [Test] - public void Image_Always_ReturnsGeneralFolderIcon() + public void Image_Always_ReturnsGenericInputOutputIcon() { // Setup using (var plugin = new RingtoetsPlugin()) @@ -116,7 +116,7 @@ Image image = info.Image(null); // Assert - TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, image); } } @@ -158,6 +158,7 @@ info.ContextMenuStrip(nodeData, null, treeViewControl); } } + // Assert mockRepository.VerifyAll(); } @@ -348,6 +349,7 @@ } } } + mockRepository.VerifyAll(); } @@ -416,6 +418,7 @@ } } } + mockRepository.VerifyAll(); } @@ -483,6 +486,7 @@ } } } + mockRepository.VerifyAll(); } @@ -562,6 +566,7 @@ } } } + mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/DesignWaterLevelLocationsGroupContextTreeNodeInfoTest.cs (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -0,0 +1,103 @@ +// Copyright (C) Stichting Deltares 2017. 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.Drawing; +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.TestUtil; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Ringtoets.Integration.Forms.PresentationObjects; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class DesignWaterLevelLocationsGroupContextTreeNodeInfoTest : NUnitFormTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.Image); + Assert.IsNull(info.ContextMenuStrip); + Assert.IsNull(info.EnsureVisibleOnCreate); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + } + + [Test] + public void Text_Always_ReturnsSetName() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + string text = info.Text(null); + + // Assert + Assert.AreEqual("Toetspeilen", text); + } + } + + [Test] + public void Image_Always_ReturnsGeneralFolderIcon() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Image image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + } + } + + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(DesignWaterLevelLocationsGroupContext)); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r0b1d32f7e945fcf7ba1f9fdaeebb61765af3f7b0 -r53bfde12ab449eba06567e6ff64627faec1d8026 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 0b1d32f7e945fcf7ba1f9fdaeebb61765af3f7b0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -58,11 +58,6 @@ private readonly string testDataPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.Integration.Service, "HydraRingCalculation"); - public override void Setup() - { - mockRepository = new MockRepository(); - } - [Test] public void Initialized_Always_ExpectedPropertiesSet() { @@ -111,7 +106,7 @@ } [Test] - public void Image_Always_ReturnsGeneralFolderIcon() + public void Image_Always_ReturnsGenericInputOutputIcon() { // Setup using (var plugin = new RingtoetsPlugin()) @@ -122,7 +117,7 @@ Image image = info.Image(null); // Assert - TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GenericInputOutputIcon, image); } } @@ -143,7 +138,7 @@ menuBuilder.Expect(mb => mb.Build()).Return(null); } - var nodeData = new WaveHeightLocationsContext(new ObservableList(), + var nodeData = new WaveHeightLocationsContext(new ObservableList(), assessmentSection); using (var treeViewControl = new TreeViewControl()) @@ -164,6 +159,7 @@ info.ContextMenuStrip(nodeData, null, treeViewControl); } } + // Assert mockRepository.VerifyAll(); } @@ -354,6 +350,7 @@ } } } + mockRepository.VerifyAll(); } @@ -422,6 +419,7 @@ } } } + mockRepository.VerifyAll(); } @@ -489,6 +487,7 @@ } } } + mockRepository.VerifyAll(); } @@ -567,9 +566,15 @@ } } } + mockRepository.VerifyAll(); } + public override void Setup() + { + mockRepository = new MockRepository(); + } + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) { return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveHeightLocationsContext)); Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/TreeNodeInfos/WaveHeightLocationsGroupContextTreeNodeInfoTest.cs (revision 53bfde12ab449eba06567e6ff64627faec1d8026) @@ -0,0 +1,104 @@ +// Copyright (C) Stichting Deltares 2017. 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.Drawing; +using System.Linq; +using Core.Common.Controls.TreeView; +using Core.Common.TestUtil; +using NUnit.Extensions.Forms; +using NUnit.Framework; +using Ringtoets.Integration.Forms.PresentationObjects; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class WaveHeightLocationsGroupContextTreeNodeInfoTest : NUnitFormTest + { + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + 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); + Assert.IsNull(info.ExpandOnCreate); + Assert.IsNull(info.ChildNodeObjects); + Assert.IsNull(info.CanRename); + Assert.IsNull(info.OnNodeRenamed); + Assert.IsNull(info.CanRemove); + Assert.IsNull(info.OnNodeRemoved); + Assert.IsNull(info.CanCheck); + Assert.IsNull(info.IsChecked); + Assert.IsNull(info.OnNodeChecked); + Assert.IsNull(info.CanDrag); + Assert.IsNull(info.CanDrop); + Assert.IsNull(info.CanInsert); + Assert.IsNull(info.OnDrop); + } + } + + [Test] + public void Text_Always_ReturnsSetName() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + string text = info.Text(null); + + // Assert + const string expectedName = "Golfhoogtes"; + Assert.AreEqual(expectedName, text); + } + } + + [Test] + public void Image_Always_ReturnsGeneralFolderIcon() + { + // Setup + using (var plugin = new RingtoetsPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Image image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralFolderIcon, image); + } + } + + private static TreeNodeInfo GetInfo(RingtoetsPlugin plugin) + { + return plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(WaveHeightLocationsGroupContext)); + } + } +} \ No newline at end of file