Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationOutputProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationOutputProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationOutputProperties.cs (revision 6200b56b8a269fc956bb09a102d2f9165fb7dd3d) @@ -0,0 +1,65 @@ +// 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; +using Core.Common.Base.Data; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of with wave height for properties panel + /// showing only output. + /// + public class WaveHeightCalculationOutputProperties : HydraulicBoundaryLocationCalculationOutputProperties + { + /// + /// Creates a new instance of . + /// + /// The hydraulic boundary location calculation. + /// The name of the category boundary this calculation belongs to. + /// Thrown when is null. + public WaveHeightCalculationOutputProperties(HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation, + string categoryBoundaryName) + : base(hydraulicBoundaryLocationCalculation, categoryBoundaryName) {} + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.WaveHeightCalculation_Result_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.WaveHeightCalculation_Result_Description))] + public override RoundedDouble Result + { + get + { + return base.Result; + } + } + + [ResourcesDescription(typeof(Resources), nameof(Resources.WaveHeightCalculation_Convergence_Description))] + public override CalculationConvergence Convergence + { + get + { + return base.Convergence; + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -rdd3fbc29b15246ce6d2496e685398011e85bd21d -r6200b56b8a269fc956bb09a102d2f9165fb7dd3d --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision dd3fbc29b15246ce6d2496e685398011e85bd21d) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 6200b56b8a269fc956bb09a102d2f9165fb7dd3d) @@ -94,6 +94,7 @@ Resources.resx + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationOutputPropertiesTest.cs =================================================================== diff -u -r91259c905e8a5a16d7a242bdbe217bda9266b428 -r6200b56b8a269fc956bb09a102d2f9165fb7dd3d --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationOutputPropertiesTest.cs (.../DesignWaterLevelCalculationOutputPropertiesTest.cs) (revision 91259c905e8a5a16d7a242bdbe217bda9266b428) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationOutputPropertiesTest.cs (.../DesignWaterLevelCalculationOutputPropertiesTest.cs) (revision 6200b56b8a269fc956bb09a102d2f9165fb7dd3d) @@ -21,7 +21,6 @@ using System; using System.ComponentModel; -using Core.Common.Gui.Converters; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; @@ -88,7 +87,7 @@ var random = new Random(); double designWaterLevel = random.NextDouble(); var convergence = random.NextEnumValue(); - var categoryBoundaryName = "A"; + const string categoryBoundaryName = "A"; var hydraulicBoundaryLocationCalculationOutput = new HydraulicBoundaryLocationCalculationOutput(designWaterLevel, random.NextDouble(), random.NextDouble(), Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationOutputPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationOutputPropertiesTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationOutputPropertiesTest.cs (revision 6200b56b8a269fc956bb09a102d2f9165fb7dd3d) @@ -0,0 +1,113 @@ +// 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; +using System.ComponentModel; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using Ringtoets.Common.Forms.PropertyClasses; + +namespace Ringtoets.Common.Forms.Test.PropertyClasses +{ + [TestFixture] + public class WaveHeightCalculationOutputPropertiesTest + { + private const int waveHeightPropertyIndex = 1; + private const int convergencePropertyIndex = 6; + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var properties = new WaveHeightCalculationOutputProperties(hydraulicBoundaryLocationCalculation, "A"); + + // Assert + Assert.IsInstanceOf(properties); + Assert.AreSame(hydraulicBoundaryLocationCalculation, properties.Data); + } + + [Test] + public void Constructor_WithValidData_PropertiesHaveExpectedAttributesValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var properties = new WaveHeightCalculationOutputProperties(hydraulicBoundaryLocationCalculation, "A"); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(8, dynamicProperties.Count); + + const string resultCategory = "Resultaat"; + + PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, + resultCategory, + "Hs [m]", + "Berekende golfhoogte.", + true); + + PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, + resultCategory, + "Convergentie", + "Is convergentie bereikt in de golfhoogte berekening?", + true); + } + + [Test] + public void GetProperties_Always_ReturnsExpectedValues() + { + // Setup + var random = new Random(); + double waveHeight = random.NextDouble(); + var convergence = random.NextEnumValue(); + const string categoryBoundaryName = "A"; + var hydraulicBoundaryLocationCalculationOutput = new HydraulicBoundaryLocationCalculationOutput(waveHeight, + random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + random.NextDouble(), + convergence, + new TestGeneralResultSubMechanismIllustrationPoint()); + + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + { + Output = hydraulicBoundaryLocationCalculationOutput + }; + + // Call + var properties = new WaveHeightCalculationOutputProperties(hydraulicBoundaryLocationCalculation, categoryBoundaryName); + + // Assert + Assert.AreEqual(hydraulicBoundaryLocationCalculation.Output.Result, properties.Result); + Assert.AreEqual(convergence, properties.Convergence); + Assert.AreEqual(categoryBoundaryName, properties.CategoryBoundaryName); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -r04ffe9435f3031323b2eeac4718e85dfd6022dbe -r6200b56b8a269fc956bb09a102d2f9165fb7dd3d --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 04ffe9435f3031323b2eeac4718e85dfd6022dbe) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 6200b56b8a269fc956bb09a102d2f9165fb7dd3d) @@ -96,6 +96,8 @@ + +