Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/EmptyOvertoppingRateOutput.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/EmptyOvertoppingRateOutput.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/EmptyOvertoppingRateOutput.cs (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -0,0 +1,29 @@ +// 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. + +namespace Ringtoets.GrassCoverErosionInwards.Data +{ + /// + /// This class represents a placeholder of a + /// that has not been calculated yet. + /// + public class EmptyOvertoppingRateOutput {} +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Ringtoets.GrassCoverErosionInwards.Data.csproj =================================================================== diff -u -re36e88b2cfbec3549a4b9e708b9c6d111a06ecb2 -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Ringtoets.GrassCoverErosionInwards.Data.csproj (.../Ringtoets.GrassCoverErosionInwards.Data.csproj) (revision e36e88b2cfbec3549a4b9e708b9c6d111a06ecb2) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/Ringtoets.GrassCoverErosionInwards.Data.csproj (.../Ringtoets.GrassCoverErosionInwards.Data.csproj) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -40,6 +40,7 @@ Properties\GlobalAssembly.cs + Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r8ef0869d98ed0941b8409519c540b73b7c19448a -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 8ef0869d98ed0941b8409519c540b73b7c19448a) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -91,15 +91,6 @@ } /// - /// Looks up a localized string similar to Overslagdebiet. - /// - public static string Categories_OvertoppingRate_Result { - get { - return ResourceManager.GetString("Categories_OvertoppingRate_Result", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Kritiek overslagdebiet per strekkende meter.. /// public static string CriticalFlowRate_Description { @@ -415,6 +406,15 @@ } /// + /// Looks up a localized string similar to Overslagdebiet. + /// + public static string OvertoppingRate_DisplayName { + get { + return ResourceManager.GetString("OvertoppingRate_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Geeft aan of ook het overslagdebiet moet worden berekend.. /// public static string OvertoppingRateCalculationType_Description { Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx =================================================================== diff -u -r8ef0869d98ed0941b8409519c540b73b7c19448a -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 8ef0869d98ed0941b8409519c540b73b7c19448a) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -222,7 +222,7 @@ Is convergentie bereikt in de HBN berekening? - + Overslagdebiet Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs =================================================================== diff -u -r8ef0869d98ed0941b8409519c540b73b7c19448a -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision 8ef0869d98ed0941b8409519c540b73b7c19448a) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsOutputProperties.cs (.../GrassCoverErosionInwardsOutputProperties.cs) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -232,7 +232,7 @@ [PropertyOrder(14)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_OvertoppingRate_DisplayName))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.GrassCoverErosionInwardsOutput_OvertoppingRate_Description))] public RoundedDouble OvertoppingRate @@ -247,7 +247,7 @@ [PropertyOrder(15)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_Description))] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] @@ -262,7 +262,7 @@ [PropertyOrder(16)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_Description))] [TypeConverter(typeof(NoValueRoundedDoubleConverter))] @@ -277,7 +277,7 @@ [PropertyOrder(17)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_Description))] [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] @@ -292,7 +292,7 @@ [PropertyOrder(18)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_Description))] [TypeConverter(typeof(NoValueRoundedDoubleConverter))] @@ -307,7 +307,7 @@ [PropertyOrder(19)] [DynamicVisible] - [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.Categories_OvertoppingRate_Result), 3, 3)] + [ResourcesCategory(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName), 3, 3)] [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_Convergence_DisplayName))] [ResourcesDescription(typeof(GrassCoverErosionInwardsFormsResources), nameof(GrassCoverErosionInwardsFormsResources.OvertoppingRateOutput_Convergence_Description))] public string OvertoppingRateConvergence Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs =================================================================== diff -u -r6083bde7bac43e93de59f788d4c95f0620dbb779 -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision 6083bde7bac43e93de59f788d4c95f0620dbb779) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Plugin/GrassCoverErosionInwardsPlugin.cs (.../GrassCoverErosionInwardsPlugin.cs) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -294,6 +294,14 @@ .AddPropertiesItem() .Build() }; + + yield return new TreeNodeInfo + { + Text = output => GrassCoverErosionInwardsFormsResources.OvertoppingRate_DisplayName, + Image = output => RingtoetsCommonFormsResources.GeneralOutputIcon, + ForeColor = output => Color.FromKnownColor(KnownColor.GrayText) + }; + } private void CalculateAll(GrassCoverErosionInwardsFailureMechanism failureMechanism, IEnumerable calculations, IAssessmentSection assessmentSection) @@ -939,6 +947,11 @@ childNodes.Add(new EmptyDikeHeightOutput()); } + if (context.WrappedData.OvertoppingRateOutput == null) + { + childNodes.Add(new EmptyOvertoppingRateOutput()); + } + return childNodes.ToArray(); } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsPluginTest.cs =================================================================== diff -u -r6083bde7bac43e93de59f788d4c95f0620dbb779 -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsPluginTest.cs (.../GrassCoverErosionInwardsPluginTest.cs) (revision 6083bde7bac43e93de59f788d4c95f0620dbb779) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/GrassCoverErosionInwardsPluginTest.cs (.../GrassCoverErosionInwardsPluginTest.cs) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -106,7 +106,7 @@ TreeNodeInfo[] treeNodeInfos = plugin.GetTreeNodeInfos().ToArray(); // Assert - Assert.AreEqual(11, treeNodeInfos.Length); + Assert.AreEqual(12, treeNodeInfos.Length); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionInwardsFailureMechanismContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(DikeProfilesContext))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionInwardsCalculationGroupContext))); @@ -118,6 +118,7 @@ Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(GrassCoverErosionInwardsOvertoppingOutput))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyDikeHeightOutput))); Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(DikeHeightOutput))); + Assert.IsTrue(treeNodeInfos.Any(tni => tni.TagType == typeof(EmptyOvertoppingRateOutput))); } } Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj =================================================================== diff -u -r6083bde7bac43e93de59f788d4c95f0620dbb779 -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj) (revision 6083bde7bac43e93de59f788d4c95f0620dbb779) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj (.../Ringtoets.GrassCoverErosionInwards.Plugin.Test.csproj) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -75,6 +75,7 @@ + Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/EmtpyOvertoppingRateOutputTreeNodeInfoTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/EmtpyOvertoppingRateOutputTreeNodeInfoTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/EmtpyOvertoppingRateOutputTreeNodeInfoTest.cs (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -0,0 +1,118 @@ +// 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.Framework; +using Rhino.Mocks; +using Ringtoets.GrassCoverErosionInwards.Data; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.GrassCoverErosionInwards.Plugin.Test.TreeNodeInfos +{ + [TestFixture] + public class EmtpyOvertoppingRateOutputTreeNodeInfoTest + { + private MockRepository mocks; + private GrassCoverErosionInwardsPlugin plugin; + private TreeNodeInfo info; + + [SetUp] + public void SetUp() + { + mocks = new MockRepository(); + plugin = new GrassCoverErosionInwardsPlugin(); + info = plugin.GetTreeNodeInfos().First(tni => tni.TagType == typeof(EmptyOvertoppingRateOutput)); + } + + [TearDown] + public void TearDown() + { + plugin.Dispose(); + mocks.VerifyAll(); + } + + [Test] + public void Initialized_Always_ExpectedPropertiesSet() + { + // Setup + mocks.ReplayAll(); + + // Assert + Assert.IsNotNull(info.Text); + Assert.IsNotNull(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_ReturnsFromResource() + { + // Setup + mocks.ReplayAll(); + + // Call + string text = info.Text(null); + + // Assert + Assert.AreEqual("Overslagdebiet", text); + } + + [Test] + public void Image_Always_ReturnsGeneralOutputIcon() + { + // Setup + mocks.ReplayAll(); + + // Call + Image image = info.Image(null); + + // Assert + TestHelper.AssertImagesAreEqual(RingtoetsCommonFormsResources.GeneralOutputIcon, image); + } + + [Test] + public void ForeColor_Always_ReturnGrayText() + { + // Call + Color foreColor = info.ForeColor(null); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), foreColor); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs =================================================================== diff -u -r8ef0869d98ed0941b8409519c540b73b7c19448a -rb2841ec8a6fc64308b1ede3988aeddc479a749a0 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs) (revision 8ef0869d98ed0941b8409519c540b73b7c19448a) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Plugin.Test/TreeNodeInfos/GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs (.../GrassCoverErosionInwardsOutputContextTreeNodeInfoTest.cs) (revision b2841ec8a6fc64308b1ede3988aeddc479a749a0) @@ -137,7 +137,7 @@ } [Test] - public void ChildNodeObjects_HBNNotCalculated_ReturnCollectionWithOutputObjects() + public void ChildNodeObjects_DikeHeightAndOvertoppingRateNotCalculated_ReturnCollectionWithEmptyOutputObjects() { // Setup var assessmentSection = mocksRepository.Stub(); @@ -146,20 +146,21 @@ var output = new GrassCoverErosionInwardsOutput(new GrassCoverErosionInwardsOvertoppingOutput( 0, true, new ProbabilityAssessmentOutput(0, 0, 0, 0, 0)), null, - new TestOvertoppingRateOutput(0)); + null); var context = new GrassCoverErosionInwardsOutputContext(output, new GrassCoverErosionInwardsFailureMechanism(), assessmentSection); // Call object[] children = info.ChildNodeObjects(context).ToArray(); // Assert - Assert.AreEqual(2, children.Length); + Assert.AreEqual(3, children.Length); var resultOutput = children[0] as GrassCoverErosionInwardsOvertoppingOutput; Assert.AreSame(context.WrappedData.OvertoppingOutput, resultOutput); Assert.IsInstanceOf(children[1]); + Assert.IsInstanceOf(children[2]); } } } \ No newline at end of file