Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs =================================================================== diff -u -r7594f72cabeb4802ffab5715e2edb2712fc1f0df -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs (.../DesignWaterLevelLocationContext.cs) (revision 7594f72cabeb4802ffab5715e2edb2712fc1f0df) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/DesignWaterLevelLocationContext.cs (.../DesignWaterLevelLocationContext.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -33,10 +33,11 @@ /// /// Creates a new instance of . /// - /// The which the belongs to. - /// The which the belongs to. - /// Thrown when any input parameter is null. - public DesignWaterLevelLocationContext(HydraulicBoundaryLocation wrappedData, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - : base(wrappedData, hydraulicBoundaryDatabase) {} + /// The + /// which the belongs to. + /// Thrown when + /// is null. + public DesignWaterLevelLocationContext(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation) {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs =================================================================== diff -u -rf70b1b56aded32ecb0e2ff593eb089f4059125db -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs (.../HydraulicBoundaryLocationContext.cs) (revision f70b1b56aded32ecb0e2ff593eb089f4059125db) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/HydraulicBoundaryLocationContext.cs (.../HydraulicBoundaryLocationContext.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -33,37 +33,11 @@ /// /// Creates a new instance of . /// - /// The + /// The /// which the belongs to. - /// The - /// which the belongs to. - /// Thrown when any input parameter is null. - protected HydraulicBoundaryLocationContext(HydraulicBoundaryLocation wrappedData, - HydraulicBoundaryDatabase hydraulicBoundaryDatabase - ) : base(wrappedData) - { - if (hydraulicBoundaryDatabase == null) - { - throw new ArgumentNullException(nameof(hydraulicBoundaryDatabase)); - } - HydraulicBoundaryDatabase = hydraulicBoundaryDatabase; - } - - /// - /// Gets the . - /// - public HydraulicBoundaryDatabase HydraulicBoundaryDatabase { get; } - - public override bool Equals(WrappedObjectContextBase other) - { - return base.Equals(other) - && ReferenceEquals(((HydraulicBoundaryLocationContext) other).HydraulicBoundaryDatabase, HydraulicBoundaryDatabase); - } - - public override int GetHashCode() - { - return base.GetHashCode() - ^ HydraulicBoundaryDatabase.GetHashCode(); - } + /// Thrown when + /// is null. + protected HydraulicBoundaryLocationContext(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation) {} } } \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs =================================================================== diff -u -r7594f72cabeb4802ffab5715e2edb2712fc1f0df -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs (.../WaveHeightLocationContext.cs) (revision 7594f72cabeb4802ffab5715e2edb2712fc1f0df) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PresentationObjects/WaveHeightLocationContext.cs (.../WaveHeightLocationContext.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -33,10 +33,10 @@ /// /// Creates a new instance of . /// - /// The which the belongs to. - /// The which the belongs to. - /// Thrown when any input parameter is null. - public WaveHeightLocationContext(HydraulicBoundaryLocation wrappedData, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - : base(wrappedData, hydraulicBoundaryDatabase) {} + /// The which the belongs to. + /// Thrown when + /// is null. + public WaveHeightLocationContext(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation) {} } } \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationProperties.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,163 @@ +// 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.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.Data.IllustrationPoints; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Integration.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of with for properties panel. + /// + public class DesignWaterLevelLocationProperties : HydraulicBoundaryLocationProperties + { + /// + /// Creates a new instance of . + /// + public DesignWaterLevelLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation, new ConstructionProperties + { + IdIndex = 1, + NameIndex = 2, + LocationIndex = 3, + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 + }) {} + + [PropertyOrder(4)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Location_DesignWaterLevel_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Location_DesignWaterLevel_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble DesignWaterLevel + { + get + { + return data.DesignWaterLevel; + } + } + + [PropertyOrder(5)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double TargetProbability + { + get + { + HydraulicBoundaryLocationOutput output = data.DesignWaterLevelCalculation.Output; + return output?.TargetProbability ?? double.NaN; + } + } + + [PropertyOrder(6)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble TargetReliability + { + get + { + HydraulicBoundaryLocationOutput output = data.DesignWaterLevelCalculation.Output; + return output?.TargetReliability ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(7)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double CalculatedProbability + { + get + { + HydraulicBoundaryLocationOutput output = data.DesignWaterLevelCalculation.Output; + return output?.CalculatedProbability ?? double.NaN; + } + } + + [PropertyOrder(8)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble CalculatedReliability + { + get + { + HydraulicBoundaryLocationOutput output = data.DesignWaterLevelCalculation.Output; + return output?.CalculatedReliability ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(9)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_Convergence_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Convergence_DesignWaterLevel_Description))] + public string Convergence + { + get + { + return new EnumDisplayWrapper(data.DesignWaterLevelCalculationConvergence).DisplayName; + } + } + + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.NotifyObservers(); + } + } + + protected override GeneralResult GetGeneralResult() + { + if (data.DesignWaterLevelCalculation.HasOutput + && data.DesignWaterLevelCalculation.Output.HasGeneralResult) + { + return data.DesignWaterLevelCalculation.Output.GeneralResult; + } + return null; + } + } +} \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsProperties.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,67 @@ +// 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.Gui.PropertyBag; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of with + /// for properties panel. + /// + public class DesignWaterLevelLocationsProperties : ObjectProperties> + { + /// + /// Creates a new instance of . + /// + /// The list of hydraulic boundary locations to set as data. + /// Thrown when is null. + public DesignWaterLevelLocationsProperties(ObservableList hydraulicBoundaryLocations) + { + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + + Data = hydraulicBoundaryLocations; + } + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Locations_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Locations_Description))] + public DesignWaterLevelLocationProperties[] Locations + { + get + { + return data.Select(loc => new DesignWaterLevelLocationProperties(loc)).ToArray(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -19,6 +19,7 @@ // 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; @@ -30,7 +31,6 @@ using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; using Ringtoets.Common.Forms.PropertyClasses; -using Ringtoets.Integration.Forms.PresentationObjects; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.PropertyClasses @@ -39,12 +39,23 @@ /// ViewModel of for properties panel. /// [TypeConverter(typeof(ExpandableObjectConverter))] - public abstract class HydraulicBoundaryLocationProperties : ObjectProperties + public abstract class HydraulicBoundaryLocationProperties : ObjectProperties { private readonly Dictionary propertyIndexLookup; - protected HydraulicBoundaryLocationProperties(ConstructionProperties propertyIndexes) + protected HydraulicBoundaryLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation, ConstructionProperties propertyIndexes) { + if (hydraulicBoundaryLocation == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocation)); + } + + if (propertyIndexes == null) + { + throw new ArgumentNullException(nameof(propertyIndexes)); + } + + Data = hydraulicBoundaryLocation; propertyIndexLookup = new Dictionary { { @@ -79,7 +90,7 @@ { get { - return data.WrappedData.Id; + return data.Id; } } @@ -91,7 +102,7 @@ { get { - return data.WrappedData.Name; + return data.Name; } } @@ -103,7 +114,7 @@ { get { - return data.WrappedData.Location; + return data.Location; } } Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationProperties.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,164 @@ +// 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.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.Data.IllustrationPoints; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Integration.Forms.Properties; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of with for properties panel. + /// + public class WaveHeightLocationProperties : HydraulicBoundaryLocationProperties + { + /// + /// Creates a new instance of . + /// + public WaveHeightLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation, new ConstructionProperties + { + IdIndex = 1, + NameIndex = 2, + LocationIndex = 3, + GoverningWindDirectionIndex = 11, + StochastsIndex = 12, + DurationsIndex = 13, + IllustrationPointsIndex = 14 + }) {} + + [PropertyOrder(4)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Location_WaveHeight_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Location_WaveHeight_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble WaveHeight + { + get + { + return data.WaveHeight; + } + } + + [PropertyOrder(5)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double TargetProbability + { + get + { + HydraulicBoundaryLocationOutput output = data.WaveHeightCalculation.Output; + return output?.TargetProbability ?? double.NaN; + } + } + + [PropertyOrder(6)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_TargetReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble TargetReliability + { + get + { + HydraulicBoundaryLocationOutput output = data.WaveHeightCalculation.Output; + return output?.TargetReliability ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(7)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedProbability_Description))] + [TypeConverter(typeof(NoProbabilityValueDoubleConverter))] + public double CalculatedProbability + { + get + { + HydraulicBoundaryLocationOutput output = data.WaveHeightCalculation.Output; + return output?.CalculatedProbability ?? double.NaN; + } + } + + [PropertyOrder(8)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_CalculatedReliability_Description))] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] + public RoundedDouble CalculatedReliability + { + get + { + HydraulicBoundaryLocationOutput output = data.WaveHeightCalculation.Output; + return output?.CalculatedReliability ?? RoundedDouble.NaN; + } + } + + [PropertyOrder(9)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_Result))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.CalculationOutput_Convergence_DisplayName))] + [ResourcesDescription(typeof(Resources), nameof(Resources.HydraulicBoundaryDatabase_Convergence_WaveHeight_Description))] + public string Convergence + { + get + { + return new EnumDisplayWrapper(data.WaveHeightCalculationConvergence).DisplayName; + } + } + + [PropertyOrder(10)] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_IllustrationPoints))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.ShouldIllustrationPointsBeCalculated_Description))] + public bool ShouldIllustrationPointsBeCalculated + { + get + { + return data.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated; + } + set + { + data.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated = value; + data.NotifyObservers(); + } + } + + protected override GeneralResult GetGeneralResult() + { + if (data.WaveHeightCalculation.HasOutput + && data.WaveHeightCalculation.Output.HasGeneralResult) + { + return data.WaveHeightCalculation.Output.GeneralResult; + } + + return null; + } + } +} \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsContextProperties.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs =================================================================== diff -u --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs (revision 0) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,67 @@ +// 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.Gui.PropertyBag; +using Core.Common.Util.Attributes; +using Ringtoets.Common.Data.Hydraulics; +using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; + +namespace Ringtoets.Integration.Forms.PropertyClasses +{ + /// + /// ViewModel of an enumeration of with + /// for properties panel. + /// + public class WaveHeightLocationsProperties : ObjectProperties> + { + /// + /// Creates a new instance of . + /// + /// The hydraulic boundary locations to set as data. + /// Thrown when is null. + public WaveHeightLocationsProperties(ObservableList hydraulicBoundaryLocations) + { + if (hydraulicBoundaryLocations == null) + { + throw new ArgumentNullException(nameof(hydraulicBoundaryLocations)); + } + + Data = hydraulicBoundaryLocations; + } + + [TypeConverter(typeof(ExpandableArrayConverter))] + [ResourcesCategory(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.Categories_General))] + [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Locations_DisplayName))] + [ResourcesDescription(typeof(RingtoetsCommonFormsResources), nameof(RingtoetsCommonFormsResources.HydraulicBoundaryDatabase_Locations_Description))] + public WaveHeightLocationProperties[] Locations + { + get + { + return data.Select(loc => new WaveHeightLocationProperties(loc)).ToArray(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -36,10 +36,10 @@ - - + + - + @@ -51,7 +51,7 @@ - + Form Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs =================================================================== diff -u -rb4a4cd5c690555b65075132adac80b146343430f -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision b4a4cd5c690555b65075132adac80b146343430f) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/DesignWaterLevelLocationsView.cs (.../DesignWaterLevelLocationsView.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -59,8 +59,7 @@ DataGridViewRow currentRow = dataGridViewControl.CurrentRow; return currentRow != null - ? new DesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject, - AssessmentSection.HydraulicBoundaryDatabase) + ? new DesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject) : null; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs =================================================================== diff -u -r55e69da3d14b07eba90b3e48c39f32f134c9a271 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision 55e69da3d14b07eba90b3e48c39f32f134c9a271) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/WaveHeightLocationsView.cs (.../WaveHeightLocationsView.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -59,8 +59,7 @@ DataGridViewRow currentRow = dataGridViewControl.CurrentRow; return currentRow != null - ? new WaveHeightLocationContext(((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject, - AssessmentSection.HydraulicBoundaryDatabase) + ? new WaveHeightLocationContext(((HydraulicBoundaryLocationRow) currentRow.DataBoundItem).CalculatableObject) : null; } Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs =================================================================== diff -u -r0d495f2706215f1b75da521c905eb6105f2f8a34 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 0d495f2706215f1b75da521c905eb6105f2f8a34) +++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -271,6 +271,7 @@ { throw new InvalidOperationException("Gui cannot be null"); } + assessmentSectionFromFileCommandHandler = new AssessmentSectionFromFileCommandHandler(Gui.MainWindow, Gui, Gui.DocumentViewController); hydraulicBoundaryLocationCalculationGuiService = new HydraulicBoundaryLocationCalculationGuiService(Gui.MainWindow); @@ -313,18 +314,24 @@ { CreateInstance = context => new StructuresOutputProperties(context.WrappedData.Output) }; - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = context => new DesignWaterLevelLocationsContextProperties( - context.WrappedData.HydraulicBoundaryDatabase) + CreateInstance = context => new DesignWaterLevelLocationsProperties( + context.WrappedData.HydraulicBoundaryDatabase.Locations) }; - yield return new PropertyInfo(); - yield return new PropertyInfo + yield return new PropertyInfo { - CreateInstance = context => new WaveHeightLocationsContextProperties( - context.WrappedData.HydraulicBoundaryDatabase) + CreateInstance = context => new DesignWaterLevelLocationProperties(context.WrappedData) }; - yield return new PropertyInfo(); + yield return new PropertyInfo + { + CreateInstance = context => new WaveHeightLocationsProperties( + context.WrappedData.HydraulicBoundaryDatabase.Locations) + }; + yield return new PropertyInfo + { + CreateInstance = context => new WaveHeightLocationProperties(context.WrappedData) + }; yield return new PropertyInfo(); yield return new PropertyInfo { @@ -635,7 +642,7 @@ { Text = categoryTreeFolder => categoryTreeFolder.Name, Image = categoryTreeFolder => GetFolderIcon(categoryTreeFolder.Category), - ChildNodeObjects = categoryTreeFolder => categoryTreeFolder.Contents.Cast().ToArray(), + ChildNodeObjects = categoryTreeFolder => categoryTreeFolder.Contents.ToArray(), ContextMenuStrip = CategoryTreeFolderContextMenu }; @@ -835,6 +842,7 @@ { return; } + IEnumerable sectionsWithHydraulicBoundaryDatabaseLinked = ringtoetsProject.AssessmentSections.Where(i => i.HydraulicBoundaryDatabase.IsLinked()); foreach (AssessmentSection section in sectionsWithHydraulicBoundaryDatabaseLinked) { @@ -922,10 +930,11 @@ if (assessmentSection != null) { return assessmentSection - .GetFailureMechanisms() - .OfType>() - .Any(fm => ReferenceEquals(viewData, fm.SectionResults)); + .GetFailureMechanisms() + .OfType>() + .Any(fm => ReferenceEquals(viewData, fm.SectionResults)); } + if (failureMechanismContext != null) { failureMechanism = failureMechanismContext.WrappedData; @@ -1131,11 +1140,11 @@ private static IEnumerable WrapFailureMechanismsInContexts(IAssessmentSection assessmentSection) { return assessmentSection - .GetFailureMechanisms() - .Select(failureMechanism => failureMechanismAssociations - .First(a => a.Match(failureMechanism)) - .Create(failureMechanism, assessmentSection)) - .ToArray(); + .GetFailureMechanisms() + .Select(failureMechanism => failureMechanismAssociations + .First(a => a.Match(failureMechanism)) + .Create(failureMechanism, assessmentSection)) + .ToArray(); } private static void AssessmentSectionOnNodeRenamed(IAssessmentSection nodeData, string newName) @@ -1225,71 +1234,85 @@ failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(duneErosion.SectionResults, nodeData); } + if (grassCoverSlipOffInwards != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(grassCoverSlipOffInwards.SectionResults, nodeData); } + if (grassCoverSlipOffOutwards != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(grassCoverSlipOffOutwards.SectionResults, nodeData); } + if (microstability != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(microstability.SectionResults, nodeData); } + if (pipingStructure != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(pipingStructure.SectionResults, nodeData); } + if (stabilityStoneCover != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(stabilityStoneCover.SectionResults, nodeData); } + if (technicalInnovation != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(technicalInnovation.SectionResults, nodeData); } + if (strengthStabilityLengthwiseConstruction != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(strengthStabilityLengthwiseConstruction.SectionResults, nodeData); } + if (waterPressureAsphaltCover != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(waterPressureAsphaltCover.SectionResults, nodeData); } + if (waveImpactAsphaltCover != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(waveImpactAsphaltCover.SectionResults, nodeData); } + if (closingStructures != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(closingStructures.SectionResults, nodeData); } + if (macroStabilityInwards != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(macroStabilityInwards.SectionResults, nodeData); } + if (macrostabilityOutwards != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(macrostabilityOutwards.SectionResults, nodeData); } + if (stabilityPointConstruction != null) { failureMechanismSectionResultContexts[0] = new FailureMechanismSectionResultContext(stabilityPointConstruction.SectionResults, nodeData); } + failureMechanismSectionResultContexts[1] = nodeData.OutputComments; return failureMechanismSectionResultContexts; } @@ -1432,6 +1455,7 @@ { return; } + IAssessmentSection assessmentSection = nodeData.WrappedData; hydraulicBoundaryLocationCalculationGuiService.CalculateWaveHeights(assessmentSection.HydraulicBoundaryDatabase.FilePath, assessmentSection.HydraulicBoundaryDatabase.EffectivePreprocessorDirectory(), Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs =================================================================== diff -u -ra1abe798a3991d9fff01eae522ccae2a43d0a931 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision a1abe798a3991d9fff01eae522ccae2a43d0a931) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/HydraulicBoundaryLocationContextTest.cs (.../HydraulicBoundaryLocationContextTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -20,9 +20,7 @@ // All rights reserved. using System; -using System.Collections.Generic; using Core.Common.Controls.PresentationObjects; -using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Integration.Forms.PresentationObjects; @@ -35,84 +33,32 @@ [Test] public void Constructor_NullHydraulicBoundaryLocation_ThrowsArgumentNullException() { - // Setup - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - // Call - TestDelegate test = () => new TestHydraulicBoundaryLocationContext(null, hydraulicBoundaryDatabase); + TestDelegate test = () => new TestHydraulicBoundaryLocationContext(null); // Assert string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("wrappedData", paramName); } [Test] - public void Constructor_NullHydraulicBoundariesDatabase_ThrowsArgumentNullException() - { - // Setup - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "Name", 2.0, 3.0); - - // Call - TestDelegate test = () => new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryDatabase", paramName); - } - - [Test] public void Constructor_ValidParameters_ExpectedValues() { // Setup - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "Name", 2.0, 3.0); // Call - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); + var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation); // Assert Assert.IsInstanceOf>(context); - Assert.AreSame(hydraulicBoundaryDatabase, context.HydraulicBoundaryDatabase); Assert.AreSame(hydraulicBoundaryLocation, context.WrappedData); } - [TestFixture] - private class HydraulicBoundaryLocationContextEqualsTest - : EqualsTestFixture - { - private static readonly HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - private static readonly HydraulicBoundaryLocation hydraulicLocation = new HydraulicBoundaryLocation(1, "Name", 2.0, 3.0); - - protected override TestHydraulicBoundaryLocationContext CreateObject() - { - return new TestHydraulicBoundaryLocationContext(hydraulicLocation, hydraulicBoundaryDatabase); - } - - protected override DerivedTestHydraulicBoundaryLocationContext CreateDerivedObject() - { - return new DerivedTestHydraulicBoundaryLocationContext(hydraulicLocation, hydraulicBoundaryDatabase); - } - - private static IEnumerable GetUnequalTestCases() - { - yield return new TestCaseData(new TestHydraulicBoundaryLocationContext(hydraulicLocation, new HydraulicBoundaryDatabase())) - .SetName("Hydraulic Boundary Database"); - yield return new TestCaseData(new TestHydraulicBoundaryLocationContext(new HydraulicBoundaryLocation(1, "Different location name", 2.0, 3.0), - hydraulicBoundaryDatabase)) - .SetName("Location"); - } - } - private class TestHydraulicBoundaryLocationContext : HydraulicBoundaryLocationContext { - public TestHydraulicBoundaryLocationContext(HydraulicBoundaryLocation wrappedData, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - : base(wrappedData, hydraulicBoundaryDatabase) {} + public TestHydraulicBoundaryLocationContext(HydraulicBoundaryLocation wrappedData) + : base(wrappedData) {} } - - private class DerivedTestHydraulicBoundaryLocationContext : TestHydraulicBoundaryLocationContext - { - public DerivedTestHydraulicBoundaryLocationContext(HydraulicBoundaryLocation wrappedData, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - : base(wrappedData, hydraulicBoundaryDatabase) {} - } } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs =================================================================== diff -u -r7594f72cabeb4802ffab5715e2edb2712fc1f0df -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision 7594f72cabeb4802ffab5715e2edb2712fc1f0df) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PresentationObjects/WaveHeightLocationContextTest.cs (.../WaveHeightLocationContextTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -32,45 +32,25 @@ [Test] public void Constructor_NullHydraulicBoundaryLocation_ThrowsArgumentNullException() { - // Setup - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - // Call - TestDelegate test = () => new WaveHeightLocationContext(null, hydraulicBoundaryDatabase); + TestDelegate test = () => new WaveHeightLocationContext(null); // Assert string paramName = Assert.Throws(test).ParamName; Assert.AreEqual("wrappedData", paramName); } [Test] - public void Constructor_NullHydraulicBoundariesDatabase_ThrowsArgumentNullException() - { - // Setup - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); - - // Call - TestDelegate test = () => new WaveHeightLocationContext(hydraulicBoundaryLocation, null); - - // Assert - string paramName = Assert.Throws(test).ParamName; - Assert.AreEqual("hydraulicBoundaryDatabase", paramName); - } - - [Test] public void Constructor_ValidParameters_ExpectedValues() { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 2.0, 3.0); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); // Call - var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); + var presentationObject = new WaveHeightLocationContext(hydraulicBoundaryLocation); // Assert Assert.IsInstanceOf(presentationObject); - Assert.AreSame(hydraulicBoundaryDatabase, presentationObject.HydraulicBoundaryDatabase); Assert.AreSame(hydraulicBoundaryLocation, presentationObject.WrappedData); } } Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationPropertiesTest.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,300 @@ +// 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.Base.Geometry; +using Core.Common.TestUtil; +using Core.Common.Util; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class DesignWaterLevelLocationPropertiesTest + { + private const int idPropertyIndex = 0; + private const int namePropertyIndex = 1; + private const int coordinatesPropertyIndex = 2; + private const int designWaterLevelPropertyIndex = 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; + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); + + // Call + var properties = new DesignWaterLevelLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.IsInstanceOf(properties); + Assert.AreSame(hydraulicBoundaryLocation, properties.Data); + } + + [Test] + public void GetProperties_ValidData_ReturnsExpectedValues() + { + // Setup + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + // Call + var properties = new DesignWaterLevelLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.AreEqual(hydraulicBoundaryLocation.Id, properties.Id); + Assert.AreEqual(hydraulicBoundaryLocation.Name, properties.Name); + Assert.AreEqual(hydraulicBoundaryLocation.Location, properties.Location); + Assert.IsNaN(properties.DesignWaterLevel); + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelLocationProperties.DesignWaterLevel)); + Assert.AreEqual(double.NaN, properties.TargetProbability); + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelLocationProperties.TargetProbability)); + Assert.IsNaN(properties.TargetReliability); + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelLocationProperties.TargetReliability)); + Assert.AreEqual(double.NaN, properties.CalculatedProbability); + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelLocationProperties.CalculatedProbability)); + Assert.IsNaN(properties.CalculatedReliability); + TestHelper.AssertTypeConverter( + nameof(DesignWaterLevelLocationProperties.CalculatedReliability)); + Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void GetProperties_ValidDesignWaterLevel_ReturnsExpectedValues(bool withIllustrationPoints) + { + // Setup + var random = new Random(); + const long id = 1234L; + const double x = 567.0; + const double y = 890.0; + const string name = ""; + + double targetProbability = random.NextDouble(); + double targetReliability = random.NextDouble(); + double calculatedProbability = random.NextDouble(); + double calculatedReliability = random.NextDouble(); + double designWaterLevel = random.NextDouble(); + var convergence = random.NextEnumValue(); + + var illustrationPoints = new[] + { + new TopLevelSubMechanismIllustrationPoint(new WindDirection("WEST", 4), "sluit", new TestSubMechanismIllustrationPoint()) + }; + var stochasts = new[] + { + new Stochast("a", 2, 3) + }; + const string governingWindDirection = "EAST"; + GeneralResult generalResult = + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) + : null; + + var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(designWaterLevel, + targetProbability, + targetReliability, + calculatedProbability, + calculatedReliability, + convergence, + generalResult); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y) + { + DesignWaterLevelCalculation = + { + Output = hydraulicBoundaryLocationOutput + } + }; + + // Call + var properties = new DesignWaterLevelLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.AreEqual(id, properties.Id); + Assert.AreEqual(name, properties.Name); + var coordinates = new Point2D(x, y); + Assert.AreEqual(coordinates, properties.Location); + Assert.AreEqual(designWaterLevel, properties.DesignWaterLevel, properties.DesignWaterLevel.GetAccuracy()); + + Assert.AreEqual(targetProbability, properties.TargetProbability); + Assert.AreEqual(targetReliability, properties.TargetReliability, properties.TargetReliability.GetAccuracy()); + Assert.AreEqual(calculatedProbability, properties.CalculatedProbability); + Assert.AreEqual(calculatedReliability, properties.CalculatedReliability, properties.CalculatedReliability.GetAccuracy()); + + string convergenceValue = new EnumDisplayWrapper(convergence).DisplayName; + Assert.AreEqual(convergenceValue, properties.Convergence); + + if (withIllustrationPoints) + { + GeneralResult expectedGeneralResult = hydraulicBoundaryLocationOutput.GeneralResult; + CollectionAssert.AreEqual(expectedGeneralResult.Stochasts, properties.AlphaValues); + CollectionAssert.AreEqual(expectedGeneralResult.Stochasts, properties.Durations); + CollectionAssert.AreEqual(expectedGeneralResult.TopLevelIllustrationPoints, properties.IllustrationPoints.Select(ip => ip.Data)); + Assert.AreEqual(expectedGeneralResult.GoverningWindDirection.Name, properties.GoverningWindDirection); + } + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Setup + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + // Call + var properties = new DesignWaterLevelLocationProperties(hydraulicBoundaryLocation); + + // Assert + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); + Assert.IsInstanceOf(classTypeConverter); + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(10, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + + 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 designWaterLevelProperty = dynamicProperties[designWaterLevelPropertyIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(designWaterLevelProperty, + resultCategory, + "Toetspeil [m+NAP]", + "Berekend toetspeil.", + 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 toetspeil berekening?", + true); + + PropertyDescriptor calculateIllustrationPointsProperty = dynamicProperties[shouldCalculateIllustrationPointsIndex]; + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(calculateIllustrationPointsProperty, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); + } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation + { + DesignWaterLevelCalculation = + { + InputParameters = + { + ShouldIllustrationPointsBeCalculated = false + } + } + }; + + hydraulicBoundaryLocation.Attach(observer); + + var properties = new DesignWaterLevelLocationProperties(hydraulicBoundaryLocation); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.DesignWaterLevelCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsPropertiesTest.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,114 @@ +// 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.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class DesignWaterLevelLocationsPropertiesTest + { + private const int requiredLocationsPropertyIndex = 0; + + [Test] + public void Constructor_WithoutDatabase_ExpectedValues() + { + // Call + TestDelegate test = () => new DesignWaterLevelLocationsProperties(null); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocations", paramName); + } + + [Test] + public void Constructor_WithHydraulicBoundaryLocations_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocations = new ObservableList(); + + // Call + var properties = new DesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); + + // Assert + Assert.IsInstanceOf>>(properties); + Assert.AreSame(hydraulicBoundaryLocations, properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); + var hydraulicBoundaryLocations = new ObservableList + { + location + }; + + // Call + var properties = new DesignWaterLevelLocationsProperties(hydraulicBoundaryLocations); + + // Assert + CollectionAssert.AllItemsAreInstancesOfType(properties.Locations, typeof(DesignWaterLevelLocationProperties)); + Assert.AreEqual(1, properties.Locations.Length); + TestHelper.AssertTypeConverter(nameof(DesignWaterLevelLocationsProperties.Locations)); + + DesignWaterLevelLocationProperties designWaterLevelLocationProperties = properties.Locations.First(); + Assert.AreEqual(location.Name, designWaterLevelLocationProperties.Name); + Assert.AreEqual(location.Id, designWaterLevelLocationProperties.Id); + Assert.AreEqual(location.Location, designWaterLevelLocationProperties.Location); + Assert.AreEqual(location.DesignWaterLevel, designWaterLevelLocationProperties.DesignWaterLevel, location.DesignWaterLevel.GetAccuracy()); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Call + var properties = new DesignWaterLevelLocationsProperties(new ObservableList()); + + // Assert + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); + Assert.IsInstanceOf(classTypeConverter); + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor locationsProperty = dynamicProperties[requiredLocationsPropertyIndex]; + Assert.IsInstanceOf(locationsProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationsProperty, + "Algemeen", + "Locaties", + "Locaties uit de hydraulische randvoorwaardendatabase.", + true); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -29,9 +29,9 @@ using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Data.TestUtil.IllustrationPoints; using Ringtoets.Common.Forms.PropertyClasses; -using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; namespace Ringtoets.Integration.Forms.Test.PropertyClasses @@ -40,26 +40,29 @@ public class HydraulicBoundaryLocationPropertiesTest { [Test] - public void Constructor_DefaultArgumentValues_DoesNotThrowException() + public void Constructor_HydraulicBoundaryLocationNull_ThrowsArgumentNullException() { - // Setup - var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); + // Call + TestDelegate test = () => new TestHydraulicBoundaryLocationProperties(null); + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocation", paramName); + } + + [Test] + public void Constructor_ConstructionPropertiesNull_ThrowsArgumentNullException() + { // Call - TestDelegate test = () => new TestHydraulicBoundaryLocationProperties - { - Data = context - }; + TestDelegate test = () => new TestHydraulicBoundaryLocationProperties(new TestHydraulicBoundaryLocation(), null); // Assert - Assert.DoesNotThrow(test); + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("propertyIndexes", paramName); } [Test] - public void GetProperties_ValidData_ReturnsExpectedValues() + public void Constructor_ValidData_ReturnsExpectedValues() { // Setup const long id = 1234L; @@ -68,15 +71,9 @@ const string name = ""; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); // Call - HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties - { - Data = context - }; + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties(hydraulicBoundaryLocation); // Assert Assert.AreEqual(id, hydraulicBoundaryLocationProperties.Id); @@ -86,7 +83,7 @@ } [Test] - public void GetProperties_ValidDataWithGeneralResult_ReturnsExpectedValues() + public void Constructor_ValidDataWithGeneralResult_ReturnsExpectedValues() { // Setup const long id = 1; @@ -95,10 +92,6 @@ const string name = "name"; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); - var random = new Random(21); var topLevelIllustrationPoint = new TopLevelSubMechanismIllustrationPoint(WindDirectionTestFactory.CreateTestWindDirection("Wind direction name"), @@ -118,9 +111,8 @@ }); // Call - var locationProperties = new TestHydraulicBoundaryLocationProperties + var locationProperties = new TestHydraulicBoundaryLocationProperties(hydraulicBoundaryLocation) { - Data = context, GeneralResult = generalResult }; @@ -159,15 +151,9 @@ const double x = 567.0; const double y = 890.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); // Call - HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties - { - Data = context - }; + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties(hydraulicBoundaryLocation); // Assert string expectedString = $"{name} {new Point2D(x, y)}"; @@ -179,15 +165,11 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); // Call - var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties + var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties(hydraulicBoundaryLocation) { - GeneralResult = new TestGeneralResultSubMechanismIllustrationPoint(), - Data = context + GeneralResult = new TestGeneralResultSubMechanismIllustrationPoint() }; // Assert @@ -253,24 +235,22 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); // Call - var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties(new HydraulicBoundaryLocationProperties.ConstructionProperties + var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties( + hydraulicBoundaryLocation, + new HydraulicBoundaryLocationProperties.ConstructionProperties + { + IllustrationPointsIndex = 1, + IdIndex = 2, + NameIndex = 3, + LocationIndex = 4, + GoverningWindDirectionIndex = 5, + StochastsIndex = 6, + DurationsIndex = 7 + }) { - IllustrationPointsIndex = 1, - IdIndex = 2, - NameIndex = 3, - LocationIndex = 4, - GoverningWindDirectionIndex = 5, - StochastsIndex = 6, - DurationsIndex = 7 - }) - { - GeneralResult = new TestGeneralResultSubMechanismIllustrationPoint(), - Data = context + GeneralResult = new TestGeneralResultSubMechanismIllustrationPoint() }; // Assert @@ -292,15 +272,9 @@ { // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); - var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - var context = new TestHydraulicBoundaryLocationContext(hydraulicBoundaryLocation, hydraulicBoundaryDatabase); // Call - var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties - { - Data = context - }; + var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties(hydraulicBoundaryLocation); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(hydraulicBoundaryLocationProperties); @@ -314,20 +288,18 @@ private class TestHydraulicBoundaryLocationProperties : HydraulicBoundaryLocationProperties { public GeneralResult GeneralResult; - public TestHydraulicBoundaryLocationProperties() : base(new ConstructionProperties()) {} - public TestHydraulicBoundaryLocationProperties(ConstructionProperties propertyIndexes) : base(propertyIndexes) {} + public TestHydraulicBoundaryLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation) + : base(hydraulicBoundaryLocation, new ConstructionProperties()) {} + public TestHydraulicBoundaryLocationProperties(HydraulicBoundaryLocation hydraulicBoundaryLocation, + ConstructionProperties propertyIndexes) + : base(hydraulicBoundaryLocation, propertyIndexes) {} + protected override GeneralResult GetGeneralResult() { return GeneralResult; } } - - private class TestHydraulicBoundaryLocationContext : HydraulicBoundaryLocationContext - { - public TestHydraulicBoundaryLocationContext(HydraulicBoundaryLocation wrappedData, HydraulicBoundaryDatabase hydraulicBoundaryDatabase) - : base(wrappedData, hydraulicBoundaryDatabase) {} - } } } \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationPropertiesTest.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,304 @@ +// 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.TestUtil; +using Core.Common.Util; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.IllustrationPoints; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; +using Ringtoets.Common.Forms.TypeConverters; +using Ringtoets.Integration.Forms.PresentationObjects; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class WaveHeightLocationPropertiesTest + { + 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; + + [Test] + public void Constructor_ExpectedValues() + { + // Setup + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, "", 0.0, 0.0); + + // Call + var properties = new WaveHeightLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.IsInstanceOf(properties); + Assert.AreSame(hydraulicBoundaryLocation, properties.Data); + } + + [Test] + public void GetProperties_ValidData_ReturnsExpectedValues() + { + // Setup + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + // Call + var properties = new WaveHeightLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.AreEqual(hydraulicBoundaryLocation.Id, properties.Id); + Assert.AreEqual(hydraulicBoundaryLocation.Name, properties.Name); + Assert.AreEqual(hydraulicBoundaryLocation.Location, properties.Location); + Assert.IsNaN(properties.WaveHeight); + TestHelper.AssertTypeConverter( + nameof(WaveHeightLocationProperties.WaveHeight)); + Assert.AreEqual(double.NaN, properties.TargetProbability); + TestHelper.AssertTypeConverter( + nameof(WaveHeightLocationProperties.TargetProbability)); + Assert.IsNaN(properties.TargetReliability); + TestHelper.AssertTypeConverter( + nameof(WaveHeightLocationProperties.TargetReliability)); + Assert.AreEqual(double.NaN, properties.CalculatedProbability); + TestHelper.AssertTypeConverter( + nameof(WaveHeightLocationProperties.CalculatedProbability)); + Assert.IsNaN(properties.CalculatedReliability); + TestHelper.AssertTypeConverter( + nameof(WaveHeightLocationProperties.CalculatedReliability)); + Assert.IsEmpty(properties.Convergence); + Assert.AreEqual(hydraulicBoundaryLocation.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated, properties.ShouldIllustrationPointsBeCalculated); + } + + [Test] + [TestCase(true)] + [TestCase(false)] + public void GetProperties_ValidWaveHeight_ReturnsExpectedValues(bool withIllustrationPoints) + { + // Setup + var random = new Random(); + const long id = 1234L; + const double x = 567.0; + const double y = 890.0; + const string name = ""; + + double targetProbability = random.NextDouble(); + double targetReliability = random.NextDouble(); + double calculatedProbability = random.NextDouble(); + double calculatedReliability = random.NextDouble(); + double waveHeight = random.NextDouble(); + var convergence = random.NextEnumValue(); + + var illustrationPoints = new[] + { + new TopLevelSubMechanismIllustrationPoint(new WindDirection("WEST", 4), "sluit", new TestSubMechanismIllustrationPoint()) + }; + var stochasts = new[] + { + new Stochast("a", 2, 3) + }; + const string governingWindDirection = "EAST"; + GeneralResult generalResult = + withIllustrationPoints + ? new GeneralResult(new WindDirection(governingWindDirection, 2), + stochasts, + illustrationPoints) + : null; + + var hydraulicBoundaryLocationOutput = new HydraulicBoundaryLocationOutput(waveHeight, + targetProbability, + targetReliability, + calculatedProbability, + calculatedReliability, + convergence, + generalResult); + + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y) + { + WaveHeightCalculation = + { + Output = hydraulicBoundaryLocationOutput + } + }; + + // Call + var properties = new WaveHeightLocationProperties(hydraulicBoundaryLocation); + + // Assert + Assert.AreEqual(hydraulicBoundaryLocation.Id, properties.Id); + Assert.AreEqual(hydraulicBoundaryLocation.Name, properties.Name); + Assert.AreEqual(hydraulicBoundaryLocation.Location, properties.Location); + Assert.AreEqual(waveHeight, properties.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); + + Assert.AreEqual(targetProbability, properties.TargetProbability); + Assert.AreEqual(targetReliability, properties.TargetReliability, properties.TargetReliability.GetAccuracy()); + Assert.AreEqual(calculatedProbability, properties.CalculatedProbability); + Assert.AreEqual(calculatedReliability, properties.CalculatedReliability, properties.CalculatedReliability.GetAccuracy()); + + string convergenceValue = new EnumDisplayWrapper(convergence).DisplayName; + Assert.AreEqual(convergenceValue, properties.Convergence); + + if (withIllustrationPoints) + { + GeneralResult expectedGeneralResult = hydraulicBoundaryLocationOutput.GeneralResult; + CollectionAssert.AreEqual(expectedGeneralResult.Stochasts, properties.AlphaValues); + CollectionAssert.AreEqual(expectedGeneralResult.Stochasts, properties.Durations); + CollectionAssert.AreEqual(expectedGeneralResult.TopLevelIllustrationPoints, properties.IllustrationPoints.Select(ip => ip.Data)); + Assert.AreEqual(expectedGeneralResult.GoverningWindDirection.Name, properties.GoverningWindDirection); + } + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Setup + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(); + + // Call + var properties = new WaveHeightLocationProperties(hydraulicBoundaryLocation); + + // Assert + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); + Assert.IsInstanceOf(classTypeConverter); + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(10, dynamicProperties.Count); + + const string generalCategory = "Algemeen"; + const string resultCategory = "Resultaat"; + + 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, + "Illustratiepunten", + "Illustratiepunten inlezen", + "Neem de informatie over de illustratiepunten op in het berekeningsresultaat."); + } + + [Test] + public void ShouldIllustrationPointsBeCalculated_SetNewValue_NotifyObservers() + { + // Setup + var mocks = new MockRepository(); + var observer = mocks.StrictMock(); + observer.Expect(o => o.UpdateObserver()); + mocks.ReplayAll(); + + HydraulicBoundaryLocation hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation + { + WaveHeightCalculation = + { + InputParameters = + { + ShouldIllustrationPointsBeCalculated = false + } + } + }; + + hydraulicBoundaryLocation.Attach(observer); + + var properties = new WaveHeightLocationProperties(hydraulicBoundaryLocation); + + // Call + properties.ShouldIllustrationPointsBeCalculated = true; + + // Assert + Assert.IsTrue(hydraulicBoundaryLocation.WaveHeightCalculation.InputParameters.ShouldIllustrationPointsBeCalculated); + mocks.VerifyAll(); + } + } +} \ No newline at end of file Fisheye: Tag 75d12c89224759df39acf21f187f309a3e4ae274 refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs =================================================================== diff -u --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs (revision 0) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -0,0 +1,114 @@ +// 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.Gui.PropertyBag; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Hydraulics; +using Ringtoets.Common.Data.TestUtil; +using Ringtoets.Integration.Forms.PropertyClasses; + +namespace Ringtoets.Integration.Forms.Test.PropertyClasses +{ + [TestFixture] + public class WaveHeightLocationsPropertiesTest + { + private const int requiredLocationsPropertyIndex = 0; + + [Test] + public void Constructor_WithoutDatabase_ExpectedValues() + { + // Call + TestDelegate test = () => new WaveHeightLocationsProperties(null); + + // Assert + string paramName = Assert.Throws(test).ParamName; + Assert.AreEqual("hydraulicBoundaryLocations", paramName); + } + + [Test] + public void Constructor_WithDatabase_ExpectedValues() + { + // Setup + var hydraulicBoundaryDatabase = new ObservableList(); + + // Call + var properties = new WaveHeightLocationsProperties(hydraulicBoundaryDatabase); + + // Assert + Assert.IsInstanceOf>>(properties); + Assert.AreSame(hydraulicBoundaryDatabase, properties.Data); + } + + [Test] + public void GetProperties_WithData_ReturnExpectedValues() + { + // Setup + HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); + var hydraulicBoundaryDatabase = new ObservableList + { + location + }; + + // Call + var properties = new WaveHeightLocationsProperties(hydraulicBoundaryDatabase); + + // Assert + CollectionAssert.AllItemsAreInstancesOfType(properties.Locations, typeof(WaveHeightLocationProperties)); + Assert.AreEqual(1, properties.Locations.Length); + TestHelper.AssertTypeConverter(nameof(WaveHeightLocationsProperties.Locations)); + + WaveHeightLocationProperties waveHeightLocationProperties = properties.Locations.First(); + Assert.AreEqual(location.Name, waveHeightLocationProperties.Name); + Assert.AreEqual(location.Id, waveHeightLocationProperties.Id); + Assert.AreEqual(location.Location, waveHeightLocationProperties.Location); + Assert.AreEqual(location.WaveHeight, waveHeightLocationProperties.WaveHeight, location.WaveHeight.GetAccuracy()); + } + + [Test] + public void Constructor_Always_PropertiesHaveExpectedAttributesValues() + { + // Call + var properties = new WaveHeightLocationsProperties(new ObservableList()); + + // Assert + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); + Assert.IsInstanceOf(classTypeConverter); + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); + Assert.AreEqual(1, dynamicProperties.Count); + + PropertyDescriptor locationsProperty = dynamicProperties[requiredLocationsPropertyIndex]; + Assert.IsInstanceOf(locationsProperty.Converter); + PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(locationsProperty, + "Algemeen", + "Locaties", + "Locaties uit de hydraulische randvoorwaardendatabase.", + true); + } + } +} \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -rac96d7c315129af851634ed5a4a6800b59ede718 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision ac96d7c315129af851634ed5a4a6800b59ede718) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -39,7 +39,6 @@ - @@ -48,15 +47,15 @@ - - + + - + - + Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -r10e6f9291398660f562b21320da82ba6b557bdf2 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 10e6f9291398660f562b21320da82ba6b557bdf2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -652,10 +652,7 @@ protected override object GetLocationSelection(LocationsView view, object selectedRowObject) { - IAssessmentSection assessmentSection = view.AssessmentSection; - - return new DesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject, - assessmentSection.HydraulicBoundaryDatabase); + return new DesignWaterLevelLocationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } protected override LocationsView ShowFullyConfiguredLocationsView(Form form) Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs =================================================================== diff -u -r10e6f9291398660f562b21320da82ba6b557bdf2 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 10e6f9291398660f562b21320da82ba6b557bdf2) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/WaveHeightLocationsViewTest.cs (.../WaveHeightLocationsViewTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -652,10 +652,7 @@ protected override object GetLocationSelection(LocationsView view, object selectedRowObject) { - IAssessmentSection assessmentSection = view.AssessmentSection; - - return new WaveHeightLocationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject, - assessmentSection.HydraulicBoundaryDatabase); + return new WaveHeightLocationContext(((HydraulicBoundaryLocationRow) selectedRowObject).CalculatableObject); } protected override LocationsView ShowFullyConfiguredLocationsView(Form form) Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs =================================================================== diff -u -ra2ce3e55443ed38bd6d7dbc7b33ff66e5d9c0d64 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs (.../DesignWaterLevelLocationsContextPropertyInfoTest.cs) (revision a2ce3e55443ed38bd6d7dbc7b33ff66e5d9c0d64) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/DesignWaterLevelLocationsContextPropertyInfoTest.cs (.../DesignWaterLevelLocationsContextPropertyInfoTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -45,7 +45,7 @@ // Assert Assert.AreEqual(typeof(DesignWaterLevelLocationsContext), info.DataType); - Assert.AreEqual(typeof(DesignWaterLevelLocationsContextProperties), info.PropertyObjectType); + Assert.AreEqual(typeof(DesignWaterLevelLocationsProperties), info.PropertyObjectType); } } @@ -70,8 +70,8 @@ IObjectProperties objectProperties = info.CreateInstance(context); // Assert - Assert.IsInstanceOf(objectProperties); - Assert.AreSame(hydraulicBoundaryDatabase, objectProperties.Data); + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(hydraulicBoundaryDatabase.Locations, objectProperties.Data); } mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs =================================================================== diff -u -ra2ce3e55443ed38bd6d7dbc7b33ff66e5d9c0d64 -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision a2ce3e55443ed38bd6d7dbc7b33ff66e5d9c0d64) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -45,7 +45,7 @@ // Assert Assert.AreEqual(typeof(WaveHeightLocationsContext), info.DataType); - Assert.AreEqual(typeof(WaveHeightLocationsContextProperties), info.PropertyObjectType); + Assert.AreEqual(typeof(WaveHeightLocationsProperties), info.PropertyObjectType); } } @@ -70,8 +70,8 @@ IObjectProperties objectProperties = info.CreateInstance(context); // Assert - Assert.IsInstanceOf(objectProperties); - Assert.AreSame(hydraulicBoundaryDatabase, objectProperties.Data); + Assert.IsInstanceOf(objectProperties); + Assert.AreSame(hydraulicBoundaryDatabase.Locations, objectProperties.Data); } mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs =================================================================== diff -u -r567010ec26005f9215844b88c139774de74c2daa -r75d12c89224759df39acf21f187f309a3e4ae274 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 567010ec26005f9215844b88c139774de74c2daa) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 75d12c89224759df39acf21f187f309a3e4ae274) @@ -266,22 +266,22 @@ PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(DesignWaterLevelLocationsContext), - typeof(DesignWaterLevelLocationsContextProperties)); + typeof(DesignWaterLevelLocationsProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(DesignWaterLevelLocationContext), - typeof(DesignWaterLevelLocationContextProperties)); + typeof(DesignWaterLevelLocationProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(WaveHeightLocationsContext), - typeof(WaveHeightLocationsContextProperties)); + typeof(WaveHeightLocationsProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos, typeof(WaveHeightLocationContext), - typeof(WaveHeightLocationContextProperties)); + typeof(WaveHeightLocationProperties)); PluginTestHelper.AssertPropertyInfoDefined( propertyInfos,