Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs
===================================================================
diff -u
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs (revision 0)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightCalculationsProperties.cs (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -0,0 +1,60 @@
+// Copyright (C) Stichting Deltares 2017. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System;
+using System.ComponentModel;
+using System.Linq;
+using Core.Common.Base;
+using Core.Common.Gui.Converters;
+using Core.Common.Util.Attributes;
+using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Forms.PropertyClasses;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.Integration.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of an enumeration of with
+ /// a wave height calculation result for properties panel.
+ ///
+ public class WaveHeightCalculationsProperties : HydraulicBoundaryLocationsProperties
+ {
+ ///
+ /// Creates a new instance of .
+ ///
+ /// The list of hydraulic boundary location calculations to set as data.
+ /// Thrown when is null.
+ public WaveHeightCalculationsProperties(ObservableList hydraulicBoundaryLocationCalculations)
+ : base(hydraulicBoundaryLocationCalculations) {}
+
+ [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 WaveHeightCalculationProperties[] Calculations
+ {
+ get
+ {
+ return data.Select(calculation => new WaveHeightCalculationProperties(calculation)).ToArray();
+ }
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 5dc34619bc10472e805e1598e06e1469bf4b6c5f refers to a dead (removed) revision in file `Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationsProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj
===================================================================
diff -u -r8b256e4113bff0cf82676406410bfa6347d27629 -r5dc34619bc10472e805e1598e06e1469bf4b6c5f
--- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 8b256e4113bff0cf82676406410bfa6347d27629)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Ringtoets.Integration.Forms.csproj (.../Ringtoets.Integration.Forms.csproj) (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -57,7 +57,7 @@
-
+
Form
Index: Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs
===================================================================
diff -u -r8b256e4113bff0cf82676406410bfa6347d27629 -r5dc34619bc10472e805e1598e06e1469bf4b6c5f
--- Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 8b256e4113bff0cf82676406410bfa6347d27629)
+++ Ringtoets/Integration/src/Ringtoets.Integration.Plugin/RingtoetsPlugin.cs (.../RingtoetsPlugin.cs) (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -341,15 +341,15 @@
{
CreateInstance = context => new DesignWaterLevelCalculationProperties(context.Calculation)
};
- yield return new PropertyInfo
+ yield return new PropertyInfo
{
CreateInstance = context =>
{
var hydraulicBoundaryLocationCalculations = new ObservableList();
hydraulicBoundaryLocationCalculations.AddRange(context.WrappedData.Select(loc => context.GetCalculationFunc(loc)));
- return new WaveHeightLocationsProperties(hydraulicBoundaryLocationCalculations);
+ return new WaveHeightCalculationsProperties(hydraulicBoundaryLocationCalculations);
}
};
yield return new PropertyInfo
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightCalculationsPropertiesTest.cs
===================================================================
diff -u
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightCalculationsPropertiesTest.cs (revision 0)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightCalculationsPropertiesTest.cs (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -0,0 +1,107 @@
+// 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 System.Linq;
+using Core.Common.Base;
+using Core.Common.Base.Data;
+using Core.Common.Gui.Converters;
+using Core.Common.TestUtil;
+using NUnit.Framework;
+using Ringtoets.Common.Data.Hydraulics;
+using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.Common.Forms.PropertyClasses;
+using Ringtoets.Integration.Forms.PropertyClasses;
+
+namespace Ringtoets.Integration.Forms.Test.PropertyClasses
+{
+ [TestFixture]
+ public class WaveHeightCalculationsPropertiesTest
+ {
+ private const int requiredLocationsPropertyIndex = 0;
+
+ [Test]
+ public void Constructor_WithHydraulicBoundaryLocationCalculations_ExpectedValues()
+ {
+ // Setup
+ var hydraulicBoundaryLocationCalculations = new ObservableList();
+
+ // Call
+ var properties = new WaveHeightCalculationsProperties(hydraulicBoundaryLocationCalculations);
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.AreSame(hydraulicBoundaryLocationCalculations, properties.Data);
+ }
+
+ [Test]
+ public void Constructor_Always_PropertiesHaveExpectedAttributesValues()
+ {
+ // Call
+ var properties = new WaveHeightCalculationsProperties(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);
+ }
+
+ [Test]
+ public void GetProperties_WithData_ReturnExpectedValues()
+ {
+ // Setup
+ var hydraulicBoundaryLocation = new TestHydraulicBoundaryLocation();
+ var hydraulicBoundaryLocationCalculation = new HydraulicBoundaryLocationCalculation(hydraulicBoundaryLocation)
+ {
+ Output = new TestHydraulicBoundaryLocationOutput(1.5)
+ };
+
+ // Call
+ var properties = new WaveHeightCalculationsProperties(new ObservableList
+ {
+ hydraulicBoundaryLocationCalculation
+ });
+
+ // Assert
+ CollectionAssert.AllItemsAreInstancesOfType(properties.Calculations, typeof(WaveHeightCalculationProperties));
+ Assert.AreEqual(1, properties.Calculations.Length);
+ TestHelper.AssertTypeConverter(nameof(WaveHeightCalculationsProperties.Calculations));
+
+ WaveHeightCalculationProperties waveHeightCalculationProperties = properties.Calculations.First();
+ Assert.AreEqual(hydraulicBoundaryLocation.Name, waveHeightCalculationProperties.Name);
+ Assert.AreEqual(hydraulicBoundaryLocation.Id, waveHeightCalculationProperties.Id);
+ Assert.AreEqual(hydraulicBoundaryLocation.Location, waveHeightCalculationProperties.Location);
+
+ RoundedDouble waveHeight = hydraulicBoundaryLocationCalculation.Output.Result;
+ Assert.AreEqual(waveHeight, waveHeightCalculationProperties.WaveHeight, waveHeight.GetAccuracy());
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 5dc34619bc10472e805e1598e06e1469bf4b6c5f refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsPropertiesTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj
===================================================================
diff -u -r8b256e4113bff0cf82676406410bfa6347d27629 -r5dc34619bc10472e805e1598e06e1469bf4b6c5f
--- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 8b256e4113bff0cf82676406410bfa6347d27629)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -62,7 +62,7 @@
-
+
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs
===================================================================
diff -u -r6f6874979aa7336da41928c20db8980841122bcf -r5dc34619bc10472e805e1598e06e1469bf4b6c5f
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision 6f6874979aa7336da41928c20db8980841122bcf)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/PropertyInfos/WaveHeightLocationsContextPropertyInfoTest.cs (.../WaveHeightLocationsContextPropertyInfoTest.cs) (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -48,7 +48,7 @@
// Assert
Assert.AreEqual(typeof(WaveHeightLocationsContext), info.DataType);
- Assert.AreEqual(typeof(WaveHeightLocationsProperties), info.PropertyObjectType);
+ Assert.AreEqual(typeof(WaveHeightCalculationsProperties), info.PropertyObjectType);
}
}
@@ -94,9 +94,9 @@
IObjectProperties objectProperties = info.CreateInstance(context);
// Assert
- Assert.IsInstanceOf(objectProperties);
+ Assert.IsInstanceOf(objectProperties);
Assert.AreSame(hydraulicBoundaryLocations, objectProperties.Data);
- WaveHeightCalculationProperties[] calculationProperties = ((WaveHeightLocationsProperties) objectProperties).Calculations;
+ WaveHeightCalculationProperties[] calculationProperties = ((WaveHeightCalculationsProperties) objectProperties).Calculations;
CollectionAssert.AreEqual(hydraulicBoundaryLocations, calculationProperties.Select(p => p.Data));
CollectionAssert.AreEqual(hydraulicBoundaryLocationCalculations.Select(c => c.Output.Result), calculationProperties.Select(p => p.WaveHeight));
}
Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs
===================================================================
diff -u -r8b256e4113bff0cf82676406410bfa6347d27629 -r5dc34619bc10472e805e1598e06e1469bf4b6c5f
--- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 8b256e4113bff0cf82676406410bfa6347d27629)
+++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/RingtoetsPluginTest.cs (.../RingtoetsPluginTest.cs) (revision 5dc34619bc10472e805e1598e06e1469bf4b6c5f)
@@ -288,7 +288,7 @@
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,
typeof(WaveHeightLocationsContext),
- typeof(WaveHeightLocationsProperties));
+ typeof(WaveHeightCalculationsProperties));
PluginTestHelper.AssertPropertyInfoDefined(
propertyInfos,