Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r2d65ef2d76be3732554f992581e092755dd5195b -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 2d65ef2d76be3732554f992581e092755dd5195b) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -1680,6 +1680,24 @@ } /// + /// Looks up a localized string similar to Berekende resultaten voor de hydraulische randvoorwaarden.. + /// + public static string WaveConditionsOutputProperties_HydraulicBoundaryLocations_Description { + get { + return ResourceManager.GetString("WaveConditionsOutputProperties_HydraulicBoundaryLocations_Description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Hydraulische randvoorwaarden. + /// + public static string WaveConditionsOutputProperties_HydraulicBoundaryLocations_DisplayName { + get { + return ResourceManager.GetString("WaveConditionsOutputProperties_HydraulicBoundaryLocations_DisplayName", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Locatie (RD) [m]. /// public static string WorldReferencePoint_DisplayName { Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r2d65ef2d76be3732554f992581e092755dd5195b -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 2d65ef2d76be3732554f992581e092755dd5195b) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -646,4 +646,10 @@ Berekende belastingen bij verschillende waterstanden (*.csv). + + Berekende resultaten voor de hydraulische randvoorwaarden. + + + Hydraulische randvoorwaarden + \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsOutputProperties.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsOutputProperties.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveConditionsOutputProperties.cs (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -0,0 +1,53 @@ +// 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.ComponentModel; +using System.Linq; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Attributes; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.Revetment.Forms.PropertyClasses; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses +{ + /// + /// ViewModel of for properties panel. + /// + public class GrassCoverErosionOutwardsWaveConditionsOutputProperties : ObjectProperties + { + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Result")] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "WaveConditionsOutputProperties_HydraulicBoundaryLocations_DisplayName")] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), "WaveConditionsOutputProperties_HydraulicBoundaryLocations_Description")] + public WaveConditionsOutputProperties[] Items + { + get + { + return data.Items.Select(conditionsoutput => new WaveConditionsOutputProperties() + { + Data = conditionsoutput + }).ToArray(); + } + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj =================================================================== diff -u -rf4590e94b14a89d075cdf5e1746823dd9eeaa847 -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision f4590e94b14a89d075cdf5e1746823dd9eeaa847) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -52,6 +52,7 @@ + Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -85,6 +85,8 @@ { GetObjectPropertiesData = context => context.WrappedData }; + + yield return new PropertyInfo(); } public override IEnumerable GetViewInfos() Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyInfos/GrassCoverErosionOutwardsOutputPropertiesTest.cs =================================================================== diff -u --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyInfos/GrassCoverErosionOutwardsOutputPropertiesTest.cs (revision 0) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyInfos/GrassCoverErosionOutwardsOutputPropertiesTest.cs (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -0,0 +1,112 @@ +// 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; +using System.ComponentModel; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using NUnit.Framework; +using Ringtoets.GrassCoverErosionOutwards.Data; +using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses; +using Ringtoets.Revetment.Data; +using Ringtoets.Revetment.Forms.PropertyClasses; + +namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.PropertyInfos +{ + [TestFixture] + public class GrassCoverErosionOutwardsOutputPropertiesTest + { + [Test] + public void DefaultConstructor_ExpectedValues() + { + // Call + var properties = new GrassCoverErosionOutwardsWaveConditionsOutputProperties(); + + //Assert + Assert.IsInstanceOf>(properties); + Assert.IsNull(properties.Data); + } + + [Test] + public void Data_WithCalculationOutput_ReturnsExpectedValues() + { + // Setup + var items = new[] + { + new WaveConditionsOutput(6, 2, 9, 4), + }; + + var grassCoverErosionOutwardsWaveConditionsOutput = new GrassCoverErosionOutwardsWaveConditionsOutput(items); + + // Call + var properties = new GrassCoverErosionOutwardsWaveConditionsOutputProperties() + { + Data = grassCoverErosionOutwardsWaveConditionsOutput + }; + + //Assert + CollectionAssert.AllItemsAreInstancesOfType(properties.Items, typeof(WaveConditionsOutputProperties)); + Assert.AreEqual(items.Length, properties.Items.Length); + Assert.AreEqual(items[0].WaterLevel, properties.Items[0].WaterLevel); + Assert.AreEqual(items[0].WaveHeight, properties.Items[0].WaveHeight); + Assert.AreEqual(items[0].WavePeakPeriod, properties.Items[0].WavePeakPeriod); + Assert.AreEqual(items[0].WaveAngle, properties.Items[0].WaveAngle); + } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var items = new[] + { + new WaveConditionsOutput(1, 0, 3, 5), + }; + + const string expectedDisplayName = "Hydraulische randvoorwaarden"; + const string expectedDescription = "Berekende resultaten voor de hydraulische randvoorwaarden."; + const string expectedCategory = "Resultaat"; + + var grassCoverErosionOutwardsOutputProperties = new GrassCoverErosionOutwardsWaveConditionsOutput(items); + var properties = new GrassCoverErosionOutwardsWaveConditionsOutputProperties() + { + Data = grassCoverErosionOutwardsOutputProperties + }; + + // Call + var propertyBag = new DynamicPropertyBag(properties); + PropertyDescriptorCollection dynamicProperties = propertyBag.GetProperties(new Attribute[] + { + new BrowsableAttribute(true) + }); + + // Assert + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor itemsProperty = dynamicProperties[0]; + Assert.IsNotNull(itemsProperty); + Assert.IsTrue(itemsProperty.IsReadOnly); + Assert.IsInstanceOf(itemsProperty.Converter); + Assert.AreEqual(expectedCategory, itemsProperty.Category); + Assert.AreEqual(expectedDisplayName, itemsProperty.DisplayName); + Assert.AreEqual(expectedDescription, itemsProperty.Description); + } + } +} \ No newline at end of file Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -82,6 +82,7 @@ + Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs =================================================================== diff -u -r254f70f60d07ff9d8778b270f80a4910cb71c053 -r88a71efb5e821ce8738d822e5c92580cfc7b172c --- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 254f70f60d07ff9d8778b270f80a4910cb71c053) +++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 88a71efb5e821ce8738d822e5c92580cfc7b172c) @@ -103,7 +103,7 @@ PropertyInfo[] propertyInfos = plugin.GetPropertyInfos().ToArray(); // Assert - Assert.AreEqual(3, propertyInfos.Length); + Assert.AreEqual(4, propertyInfos.Length); PropertyInfo grassCoverErosionOutwardsFailureMechanismProperties = PluginTestHelper.AssertPropertyInfoDefined< GrassCoverErosionOutwardsFailureMechanismContext, @@ -122,6 +122,12 @@ GrassCoverErosionOutwardsWaveHeightLocationsContextProperties>(propertyInfos); Assert.IsNull(waveHeightLocationContextProperties.AdditionalDataCheck); Assert.IsNull(waveHeightLocationContextProperties.AfterCreate); + + var grassCoverErosionWaveConditionsOutputProperties = PluginTestHelper.AssertPropertyInfoDefined< + GrassCoverErosionOutwardsWaveConditionsOutput, + GrassCoverErosionOutwardsWaveConditionsOutputProperties>(propertyInfos); + Assert.IsNull(grassCoverErosionWaveConditionsOutputProperties.AdditionalDataCheck); + Assert.IsNull(grassCoverErosionWaveConditionsOutputProperties.AfterCreate); } }