Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationProperties.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,69 @@ +// 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.Gui.Attributes; +using Core.Common.Util; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of with for properties panel. + /// + public class DesignWaterLevelCalculationProperties : HydraulicBoundaryLocationCalculationProperties + { + /// + /// Creates a new instance of . + /// + /// The hydraulic boundary location calculation. + /// Thrown when is null. + public DesignWaterLevelCalculationProperties(HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation) + : base(hydraulicBoundaryLocationCalculation) {} + + [ResourcesDisplayName(typeof(Resources), nameof(Resources.DesignWaterLevelCalculation_Result_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.DesignWaterLevelCalculation_Result_Description))] + public override RoundedDouble DesignWaterLevel + { + get + { + return base.DesignWaterLevel; + } + } + + [PropertyOrder(9)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Result))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.CalculationOutput_Convergence_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.DesignWaterLevelCalculation_Convergence_Description))] + public string Convergence + { + get + { + CalculationConvergence convergence = data.Output?.CalculationConvergence ?? CalculationConvergence.NotCalculated; + + return new EnumDisplayWrapper(convergence).DisplayName; + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsGroupProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsGroupProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsGroupProperties.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,80 @@ +// 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.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using Core.Common.Base; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of for properties panel. + /// + public class DesignWaterLevelCalculationsGroupProperties : ObjectProperties> + { + private readonly IEnumerable, string>> calculationCollections; + + /// + /// Creates a new instance of . + /// + /// The locations to set as data. + /// Thrown when any parameter is null. + public DesignWaterLevelCalculationsGroupProperties(ObservableList locations) + { + if (locations == null) + { + throw new ArgumentNullException(nameof(locations)); + } + + if (calculationCollections == null) + { + throw new ArgumentNullException(nameof(calculationCollections)); + } + + Data = locations; + } + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_Description))] + public HydraulicBoundaryLocationProperties[] Locations + { + get + { + return data.Select(location => new HydraulicBoundaryLocationProperties(location)).ToArray(); + } + } + + private IEnumerable> GetHydraulicBoundaryLocationCalculationsForLocation(HydraulicBoundaryLocation location) + { + return calculationCollections.Select(collection => new Tuple( + collection.Item1.Single(c => ReferenceEquals(c.HydraulicBoundaryLocation, location)), collection.Item2)); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/DesignWaterLevelCalculationsProperties.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,59 @@ +// 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 System.Linq; +using Core.Common.Base; +using Core.Common.Gui.Converters; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of with + /// a design water level calculation result for properties panel. + /// + public class DesignWaterLevelCalculationsProperties : HydraulicBoundaryLocationCalculationsProperties + { + /// + /// Creates a new instance of . + /// + /// The enumeration of hydraulic boundary location calculations to set as data. + /// Thrown when is null. + public DesignWaterLevelCalculationsProperties(IObservableEnumerable hydraulicBoundaryLocationCalculations) + : base(hydraulicBoundaryLocationCalculations) {} + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_Description))] + public DesignWaterLevelCalculationProperties[] Calculations + { + get + { + return data.Select(calculation => new DesignWaterLevelCalculationProperties(calculation)).ToArray(); + } + } + } +} \ No newline at end of file Fisheye: Tag 3fe0426d07701bbdc8c2e45d376bae2d12a56f2f refers to a dead (removed) revision in file `Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationProperties.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,74 @@ +// 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.Base.Data; +using Core.Common.Gui.Attributes; +using Core.Common.Util; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of with for properties panel. + /// + public class WaveHeightCalculationProperties : HydraulicBoundaryLocationCalculationProperties + { + /// + /// Creates a new instance of . + /// + /// The hydraulic boundary location calculation. + /// Thrown when is null. + public WaveHeightCalculationProperties(HydraulicBoundaryLocationCalculation hydraulicBoundaryLocationCalculation) + : base(hydraulicBoundaryLocationCalculation) {} + + [PropertyOrder(4)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Result))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.WaveHeightCalculation_Result_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.WaveHeightCalculation_Result_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public override RoundedDouble DesignWaterLevel + { + get + { + return base.DesignWaterLevel; + } + } + + [PropertyOrder(9)] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_Result))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.CalculationOutput_Convergence_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.WaveHeightCalculation_Convergence_Description))] + public string Convergence + { + get + { + CalculationConvergence convergence = data.Output?.CalculationConvergence ?? CalculationConvergence.NotCalculated; + + return new EnumDisplayWrapper(convergence).DisplayName; + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,59 @@ +// 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 System.Linq; +using Core.Common.Base; +using Core.Common.Gui.Converters; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Forms.Properties; + +namespace Ringtoets.Common.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of with + /// a wave height calculation result for properties panel. + /// + public class WaveHeightCalculationsProperties : HydraulicBoundaryLocationCalculationsProperties + { + /// + /// Creates a new instance of . + /// + /// The enumeration of hydraulic boundary location calculations to set as data. + /// Thrown when is null. + public WaveHeightCalculationsProperties(IObservableEnumerable hydraulicBoundaryLocationCalculations) + : base(hydraulicBoundaryLocationCalculations) {} + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(Resources), nameof(Resources.Categories_General))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Locations_Description))] + public WaveHeightCalculationProperties[] Calculations + { + get + { + return data.Select(calculation => new WaveHeightCalculationProperties(calculation)).ToArray(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationsGroupPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationsGroupPropertiesTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/DesignWaterLevelCalculationsGroupPropertiesTest.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,101 @@ +// 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.Base; +using Core.Common.Gui.Converters; +using Core.Common.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Forms.PropertyClasses; + +namespace Ringtoets.Common.Forms.Test.PropertyClasses +{ + [TestFixture] + public class DesignWaterLevelCalculationsGroupPropertiesTest + { + [Test] + public void Constructor_LocationsNull_ThrowsArgumentNullException() + { + // Call + TestDelegate call = () => new DesignWaterLevelCalculationsGroupProperties(null); + + // Assert + var exception = Assert.Throws(call); + Assert.AreEqual("locations", exception.ParamName); + } + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var locations = new ObservableList(); + + // Call + var properties = new DesignWaterLevelCalculationsGroupProperties(locations); + + // Assert + Assert.IsInstanceOf>>(properties); + Assert.AreSame(locations, properties.Data); + + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelCalculationsGroupProperties.Locations)); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Call + var properties = new DesignWaterLevelCalculationsGroupProperties(new ObservableList()); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor locationsProperty = dynamicProperties[0]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationsProperty, + "Algemeen", + "Locaties", + "Locaties uit de hydraulische randvoorwaardendatabase.", + true); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + var location = new TestHydraulicBoundaryLocation(); + + // Call + var properties = new DesignWaterLevelCalculationsGroupProperties(new ObservableList + { + location + }); + + // Assert + Assert.AreEqual(1, properties.Locations.Length); + Assert.AreSame(location, properties.Locations[0].Data); + } + } +} \ No newline at end of file Fisheye: Tag 3fe0426d07701bbdc8c2e45d376bae2d12a56f2f refers to a dead (removed) revision in file `Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationPropertiesTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/PropertyClasses/WaveHeightCalculationPropertiesTest.cs (revision c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b) @@ -0,0 +1,303 @@ +// 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.Gui.Converters; +using Core.Common.TestUtil; +using Core.Common.Util; +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 WaveHeightCalculationPropertiesTest + { + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int coordinatesPropertyIndex = 2; + private const int waveHeightPropertyIndex = 3; + private const int targetProbabilityPropertyIndex = 4; + private const int targetReliabilityPropertyIndex = 5; + private const int calculatedProbabilityPropertyIndex = 6; + private const int calculatedReliabilityPropertyIndex = 7; + private const int convergencePropertyIndex = 8; + private const int shouldCalculateIllustrationPointsIndex = 9; + private const int governingWindDirectionIndex = 10; + private const int alphaValuesIndex = 11; + private const int durationsIndex = 12; + private const int illustrationPointsIndex = 13; + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var properties = new WaveHeightCalculationProperties(hydraulicBoundaryLocationCalculation); + + // Assert + Assert.IsInstanceOf(properties); + Assert.AreSame(hydraulicBoundaryLocationCalculation, properties.Data); + } + + [Test] + public void Constructor_WithoutGeneralIllustrationPointsResult_PropertiesHaveExpectedAttributesValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()); + + // Call + var properties = new WaveHeightCalculationProperties(hydraulicBoundaryLocationCalculation); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(10, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + const string illustrationPointsCategory = "Illustratiepunten"; + + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + generalCategory, + "ID", + "ID van de hydraulische randvoorwaardenlocatie in de database.", + true); + + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "Naam van de hydraulische randvoorwaardenlocatie.", + true); + + PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, + generalCategory, + "Coördinaten [m]", + "Coördinaten van de hydraulische randvoorwaardenlocatie.", + true); + + PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, + resultCategory, + "Hs [m]", + "Berekende golfhoogte.", + true); + + PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, + resultCategory, + "Doelkans [1/jaar]", + "De ingevoerde kans waarvoor het resultaat moet worden berekend.", + true); + + PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, + resultCategory, + "Betrouwbaarheidsindex doelkans [-]", + "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", + true); + + PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, + resultCategory, + "Berekende kans [1/jaar]", + "De berekende kans van voorkomen van het berekende resultaat.", + true); + + PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, + resultCategory, + "Betrouwbaarheidsindex berekende kans [-]", + "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", + true); + + PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, + resultCategory, + "Convergentie", + "Is convergentie bereikt in de golfhoogte berekening?", + true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + illustrationPointsCategory, + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); + } + + [Test] + public void Constructor_WithGeneralIllustrationPointsResult_PropertiesHaveExpectedAttributesValues() + { + // Setup + var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(new TestHydraulicBoundaryLocation()) + { + Output = new TestHydraulicBoundaryLocationCalculationOutput(new TestGeneralResultSubMechanismIllustrationPoint()) + }; + + // Call + var properties = new WaveHeightCalculationProperties(hydraulicBoundaryLocationCalculation); + + // Assert + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(14, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + const string illustrationPointsCategory = "Illustratiepunten"; + + PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, + generalCategory, + "ID", + "ID van de hydraulische randvoorwaardenlocatie in de database.", + true); + + PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, + generalCategory, + "Naam", + "Naam van de hydraulische randvoorwaardenlocatie.", + true); + + PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, + generalCategory, + "Coördinaten [m]", + "Coördinaten van de hydraulische randvoorwaardenlocatie.", + true); + + PropertyDescriptor waveHeightProperty = dynamicProperties[waveHeightPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(waveHeightProperty, + resultCategory, + "Hs [m]", + "Berekende golfhoogte.", + true); + + PropertyDescriptor targetProbabilityProperty = dynamicProperties[targetProbabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetProbabilityProperty, + resultCategory, + "Doelkans [1/jaar]", + "De ingevoerde kans waarvoor het resultaat moet worden berekend.", + true); + + PropertyDescriptor targetReliabilityProperty = dynamicProperties[targetReliabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(targetReliabilityProperty, + resultCategory, + "Betrouwbaarheidsindex doelkans [-]", + "Betrouwbaarheidsindex van de ingevoerde kans waarvoor het resultaat moet worden berekend.", + true); + + PropertyDescriptor calculatedProbabilityProperty = dynamicProperties[calculatedProbabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedProbabilityProperty, + resultCategory, + "Berekende kans [1/jaar]", + "De berekende kans van voorkomen van het berekende resultaat.", + true); + + PropertyDescriptor calculatedReliabilityProperty = dynamicProperties[calculatedReliabilityPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculatedReliabilityProperty, + resultCategory, + "Betrouwbaarheidsindex berekende kans [-]", + "Betrouwbaarheidsindex van de berekende kans van voorkomen van het berekende resultaat.", + true); + + PropertyDescriptor convergenceProperty = dynamicProperties[convergencePropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(convergenceProperty, + resultCategory, + "Convergentie", + "Is convergentie bereikt in de golfhoogte berekening?", + true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + illustrationPointsCategory, + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dynamicProperties[governingWindDirectionIndex], + illustrationPointsCategory, + "Maatgevende windrichting", + "De windrichting waarvoor de berekende betrouwbaarheidsindex het laagst is.", + true); + + PropertyDescriptor alphaValuesProperty = dynamicProperties[alphaValuesIndex]; + Assert.NotNull(alphaValuesProperty.Attributes[typeof(KeyValueElementAttribute)]); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(alphaValuesProperty, + illustrationPointsCategory, + "Invloedscoëfficiënten [-]", + "Berekende invloedscoëfficiënten voor alle beschouwde stochasten.", + true); + + PropertyDescriptor durationsProperty = dynamicProperties[durationsIndex]; + Assert.NotNull(durationsProperty.Attributes[typeof(KeyValueElementAttribute)]); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(durationsProperty, + illustrationPointsCategory, + "Tijdsduren [uur]", + "Tijdsduren waarop de stochasten betrekking hebben.", + true); + + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(dynamicProperties[illustrationPointsIndex], + illustrationPointsCategory, + "Illustratiepunten", + "De lijst van illustratiepunten voor de berekening.", + true); + } + + [Test] + public void GetProperties_Always_ReturnsExpectedValues() + { + // Setup + var random = new Random(); + double waveHeight = random.NextDouble(); + var convergence = random.NextEnumValue(); + + 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 WaveHeightCalculationProperties(hydraulicBoundaryLocationCalculation); + + // Assert + Assert.AreEqual(hydraulicBoundaryLocationCalculation.Output.Result, properties.DesignWaterLevel); + + string convergenceValue = new EnumDisplayWrapper(convergence).DisplayName; + Assert.AreEqual(convergenceValue, properties.Convergence); + } + } +} \ No newline at end of file Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelCalculationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelCalculationsProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightCalculationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaveHeightCalculationsProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelCalculationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelCalculationsPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightCalculationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightCalculationsPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelCalculationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelCalculationsGroupProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelCalculationsProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightCalculationProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelCalculationsGroupPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag c78bc8b201c53e91bd6ef0579876cbdcd9dc5b6b refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightCalculationPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff?