Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Data/GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocation.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -21,7 +21,7 @@
using System;
using Core.Common.Base.Data;
-using Core.Common.Base.Storage;
+using Core.Common.Base.Geometry;
using Ringtoets.HydraRing.Data;
namespace Ringtoets.GrassCoverErosionOutwards.Data
@@ -30,53 +30,49 @@
/// Hydraulic boundary location for which values are calculated during the assessment of the
/// .
///
- public class GrassCoverErosionOutwardsHydraulicBoundaryLocation : IStorable
+ public class GrassCoverErosionOutwardsHydraulicBoundaryLocation : IHydraulicBoundaryLocation
{
- private RoundedDouble waterLevel;
+ private readonly IHydraulicBoundaryLocation hydraulicBoundaryLocation;
+ private RoundedDouble designWaterLevel;
private RoundedDouble waveHeight;
///
/// Creates a new instance of .
///
- /// The
+ /// The
/// which is used in the calculation of grass cover erosion outwards specific properties of the
/// location.
/// Thrown when is null.
- public GrassCoverErosionOutwardsHydraulicBoundaryLocation(HydraulicBoundaryLocation hydraulicBoundaryLocation)
+ public GrassCoverErosionOutwardsHydraulicBoundaryLocation(IHydraulicBoundaryLocation hydraulicBoundaryLocation)
{
if (hydraulicBoundaryLocation == null)
{
throw new ArgumentNullException("hydraulicBoundaryLocation");
}
- HydraulicBoundaryLocation = hydraulicBoundaryLocation;
- waterLevel = new RoundedDouble(2, double.NaN);
+ this.hydraulicBoundaryLocation = hydraulicBoundaryLocation;
+ designWaterLevel = new RoundedDouble(2, double.NaN);
waveHeight = new RoundedDouble(2, double.NaN);
}
///
- /// Gets the .
+ /// Gets or sets the design water level of .
///
- public HydraulicBoundaryLocation HydraulicBoundaryLocation { get; private set; }
-
- ///
- /// Gets or sets the water level of .
- ///
- public RoundedDouble WaterLevel
+ public RoundedDouble DesignWaterLevel
{
get
{
- return waterLevel;
+ return designWaterLevel;
}
set
{
- waterLevel = value.ToPrecision(waterLevel.NumberOfDecimalPlaces);
+ designWaterLevel = value.ToPrecision(designWaterLevel.NumberOfDecimalPlaces);
}
}
///
- /// Gets or sets the convergence status of the water level calculation.
+ /// Gets or sets the convergence status of the design water level calculation.
///
- public CalculationConvergence WaterLevelCalculationConvergence { get; set; }
+ public CalculationConvergence DesignWaterLevelCalculationConvergence { get; set; }
///
/// Gets or sets the wave height of .
@@ -98,6 +94,30 @@
///
public CalculationConvergence WaveHeightCalculationConvergence { get; set; }
+ public long Id
+ {
+ get
+ {
+ return hydraulicBoundaryLocation.Id;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return hydraulicBoundaryLocation.Name;
+ }
+ }
+
+ public Point2D Location
+ {
+ get
+ {
+ return hydraulicBoundaryLocation.Location;
+ }
+ }
+
///
/// Gets or sets the unique identifier for the storage of the class.
///
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaterLevelLocationContext.cs
===================================================================
diff -u -r7546a65303cc9421d2ebe115c5dac56164371e07 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaterLevelLocationContext.cs (.../GrassCoverErosionOutwardsWaterLevelLocationContext.cs) (revision 7546a65303cc9421d2ebe115c5dac56164371e07)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PresentationObjects/GrassCoverErosionOutwardsWaterLevelLocationContext.cs (.../GrassCoverErosionOutwardsWaterLevelLocationContext.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -27,7 +27,7 @@
{
///
/// Presentation object for all data required to configure an instance of
- /// with .
+ /// with .
///
public class GrassCoverErosionOutwardsWaterLevelLocationContext : GrassCoverErosionOutwardsHydraulicBoundaryLocationContext
{
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.Designer.cs
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -102,10 +102,10 @@
///
/// Looks up a localized string similar to Is convergentie bereikt in de waterstand bij doorsnede-eis berekening?.
///
- public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_Convergence_WaterLevel_Description {
+ public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_Convergence_DesignWaterLevel_Description {
get {
- return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_Convergence_WaterLevel_Descrip" +
- "tion", resourceCulture);
+ return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_Convergence_DesignWaterLevel_D" +
+ "escription", resourceCulture);
}
}
@@ -122,18 +122,18 @@
///
/// Looks up a localized string similar to Berekende waterstand bij doorsnede-eis..
///
- public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_WaterLevel_Description {
+ public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_Description {
get {
- return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_WaterLevel_Description", resourceCulture);
+ return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_Description", resourceCulture);
}
}
///
/// Looks up a localized string similar to Waterstand bij doorsnede-eis [m+NAP].
///
- public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_WaterLevel_DisplayName {
+ public static string GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_DisplayName {
get {
- return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_WaterLevel_DisplayName", resourceCulture);
+ return ResourceManager.GetString("GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_DisplayName", resourceCulture);
}
}
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.resx
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Properties/Resources.resx (.../Resources.resx) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -129,13 +129,13 @@
Waterstand bij doorsnede-eis
-
+
Berekende waterstand bij doorsnede-eis.
-
+
Waterstand bij doorsnede-eis [m+NAP]
-
+
Is convergentie bereikt in de waterstand bij doorsnede-eis berekening?
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (revision 0)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties.cs (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -0,0 +1,95 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.ComponentModel;
+using Core.Common.Base.Data;
+using Core.Common.Base.Geometry;
+using Core.Common.Gui.Attributes;
+using Core.Common.Utils;
+using Core.Common.Utils.Attributes;
+using Ringtoets.Common.Forms.TypeConverters;
+using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.GrassCoverErosionOutwards.Forms.Properties;
+using Ringtoets.HydraRing.Data;
+using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources;
+
+namespace Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of with
+ /// for properties panel.
+ ///
+ [TypeConverter(typeof(ExpandableObjectConverter))]
+ public class GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties : GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties
+ {
+ [PropertyOrder(1)]
+ public override long Id
+ {
+ get
+ {
+ return base.Id;
+ }
+ }
+
+ [PropertyOrder(2)]
+ public override string Name
+ {
+ get
+ {
+ return base.Name;
+ }
+ }
+
+ [PropertyOrder(3)]
+ public override Point2D Location
+ {
+ get
+ {
+ return base.Location;
+ }
+ }
+
+ [PropertyOrder(4)]
+ [TypeConverter(typeof(NoValueRoundedDoubleConverter))]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_DisplayName")]
+ [ResourcesDescription(typeof(Resources), "GrassCoverErosionOutwardsHydraulicBoundaryLocation_DesignWaterLevel_Description")]
+ public RoundedDouble DesignWaterLevel
+ {
+ get
+ {
+ return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel;
+ }
+ }
+
+ [PropertyOrder(5)]
+ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_General")]
+ [ResourcesDisplayName(typeof(RingtoetsCommonFormsResources), "HydraulicBoundaryDatabase_Convergence_DisplayName")]
+ [ResourcesDescription(typeof(Resources), "GrassCoverErosionOutwardsHydraulicBoundaryLocation_Convergence_DesignWaterLevel_Description")]
+ public string Convergence
+ {
+ get
+ {
+ return new EnumDisplayWrapper(data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence).DisplayName;
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties.cs (revision 0)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties.cs (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -0,0 +1,55 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.ComponentModel;
+using System.Linq;
+using Core.Common.Base;
+using Core.Common.Gui.Converters;
+using Core.Common.Gui.PropertyBag;
+using Core.Common.Utils.Attributes;
+using Ringtoets.Common.Forms.Properties;
+using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects;
+
+namespace Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses
+{
+ ///
+ /// ViewModel of an enumeration of with
+ /// for properties panel.
+ ///
+ public class GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties : ObjectProperties>
+ {
+ [TypeConverter(typeof(ExpandableArrayConverter))]
+ [ResourcesCategory(typeof(Resources), "Categories_General")]
+ [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_DisplayName")]
+ [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Description")]
+ public GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties[] Locations
+ {
+ get
+ {
+ return data.Select(loc => new GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties
+ {
+ Data = new GrassCoverErosionOutwardsWaterLevelLocationContext(data, loc)
+ }).ToArray();
+ }
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties.cs
===================================================================
diff -u -rf2be29fe8c407a4f32cb1bfcbaf4816c1f99c83f -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties.cs) (revision f2be29fe8c407a4f32cb1bfcbaf4816c1f99c83f)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationProperties.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -42,7 +42,7 @@
{
get
{
- return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.HydraulicBoundaryLocation.Id;
+ return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.Id;
}
}
@@ -53,7 +53,7 @@
{
get
{
- return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.HydraulicBoundaryLocation.Name;
+ return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.Name;
}
}
@@ -64,7 +64,7 @@
{
get
{
- return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.HydraulicBoundaryLocation.Location;
+ return data.GrassCoverErosionOutwardsHydraulicBoundaryLocation.Location;
}
}
Fisheye: Tag 4f5e140bd0d2891988a862ff4c5749a7991a12b0 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaterLevelLocationContextProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 4f5e140bd0d2891988a862ff4c5749a7991a12b0 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/PropertyClasses/GrassCoverErosionOutwardsWaterLevelLocationsContextProperties.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Forms/Ringtoets.GrassCoverErosionOutwards.Forms.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.csproj) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -56,8 +56,8 @@
-
-
+
+
Index: Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs
===================================================================
diff -u -rf52ef19a25b70e103b1ca6bc5f84021b68138f41 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision f52ef19a25b70e103b1ca6bc5f84021b68138f41)
+++ Ringtoets/GrassCoverErosionOutwards/src/Ringtoets.GrassCoverErosionOutwards.Plugin/GrassCoverErosionOutwardsPlugin.cs (.../GrassCoverErosionOutwardsPlugin.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -53,7 +53,7 @@
{
GetObjectPropertiesData = context => context.WrappedData
};
- yield return new PropertyInfo
+ yield return new PropertyInfo
{
GetObjectPropertiesData = context => context.Locations
};
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Data.Test/GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs (.../GrassCoverErosionOutwardsHydraulicBoundaryLocationTest.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -21,8 +21,9 @@
using System;
using Core.Common.Base.Data;
-using Core.Common.Base.Storage;
using NUnit.Framework;
+using Rhino.Mocks;
+using Ringtoets.Common.Data.TestUtil;
using Ringtoets.HydraRing.Data;
namespace Ringtoets.GrassCoverErosionOutwards.Data.Test
@@ -51,11 +52,13 @@
var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(hydraulicBoundaryLocation);
// Assert
- Assert.IsInstanceOf(grassCoverErosionOutwardsHydraulicBoundaryLocation);
- Assert.AreSame(hydraulicBoundaryLocation, grassCoverErosionOutwardsHydraulicBoundaryLocation.HydraulicBoundaryLocation);
- Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaterLevel);
- Assert.AreEqual(2, grassCoverErosionOutwardsHydraulicBoundaryLocation.WaterLevel.NumberOfDecimalPlaces);
- Assert.AreEqual(CalculationConvergence.NotCalculated, grassCoverErosionOutwardsHydraulicBoundaryLocation.WaterLevelCalculationConvergence);
+ Assert.IsInstanceOf(grassCoverErosionOutwardsHydraulicBoundaryLocation);
+ Assert.AreEqual(hydraulicBoundaryLocation.Name, grassCoverErosionOutwardsHydraulicBoundaryLocation.Name);
+ Assert.AreEqual(hydraulicBoundaryLocation.Id, grassCoverErosionOutwardsHydraulicBoundaryLocation.Id);
+ Assert.AreEqual(hydraulicBoundaryLocation.Location, grassCoverErosionOutwardsHydraulicBoundaryLocation.Location);
+ Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel);
+ Assert.AreEqual(2, grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel.NumberOfDecimalPlaces);
+ Assert.AreEqual(CalculationConvergence.NotCalculated, grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence);
Assert.IsNaN(grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight);
Assert.AreEqual(2, grassCoverErosionOutwardsHydraulicBoundaryLocation.WaveHeight.NumberOfDecimalPlaces);
@@ -66,15 +69,19 @@
public void WaterLevel_ValidParameters_ReturnsExpectedValues()
{
// Setup
- var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 0.0, 0.0);
- var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(hydraulicBoundaryLocation);
+ var mockRepository = new MockRepository();
+ var hydraulicBoundaryLocationMock = mockRepository.StrictMock();
+ mockRepository.ReplayAll();
+ var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(hydraulicBoundaryLocationMock);
var waterLevel = (RoundedDouble) 1.23456;
// Call
- grassCoverErosionOutwardsHydraulicBoundaryLocation.WaterLevel = waterLevel;
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel = waterLevel;
// Assert
- Assert.AreEqual(1.23, grassCoverErosionOutwardsHydraulicBoundaryLocation.WaterLevel, 1e-8);
+ Assert.AreEqual(waterLevel, grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel,
+ grassCoverErosionOutwardsHydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy());
+ mockRepository.VerifyAll();
}
[Test]
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs (revision 0)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest.cs (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -0,0 +1,172 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.ComponentModel;
+using Core.Common.Base;
+using Core.Common.Base.Data;
+using Core.Common.Base.Geometry;
+using Core.Common.Gui.PropertyBag;
+using NUnit.Framework;
+using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.GrassCoverErosionOutwards.Forms.PresentationObjects;
+using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses;
+using Ringtoets.HydraRing.Data;
+
+namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.PropertyClasses
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsDesignWaterLevelLocationContextPropertiesTest
+ {
+ [Test]
+ public void Constructor_ExpectedValues()
+ {
+ // Call
+ var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties();
+
+ // Assert
+ Assert.IsInstanceOf(properties);
+ Assert.IsNull(properties.Data);
+ }
+
+ [Test]
+ [TestCase(CalculationConvergence.CalculatedConverged, "Ja")]
+ [TestCase(CalculationConvergence.CalculatedNotConverged, "Nee")]
+ [TestCase(CalculationConvergence.NotCalculated, "")]
+ public void GetProperties_ValidData_ReturnsExpectedValues(CalculationConvergence convergenceReached, string expectedConvergenceValue)
+ {
+ // Setup
+ const long id = 1;
+ const double x = 567.0;
+ const double y = 890.0;
+ const string name = "name";
+ var designWaterLevel = (RoundedDouble) 1234;
+ var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(
+ new HydraulicBoundaryLocation(id, name, x, y))
+ {
+ DesignWaterLevel = designWaterLevel,
+ DesignWaterLevelCalculationConvergence = convergenceReached
+ };
+ var locations = new ObservableList
+ {
+ grassCoverErosionOutwardsHydraulicBoundaryLocation
+ };
+ var context = new GrassCoverErosionOutwardsWaterLevelLocationContext(locations, grassCoverErosionOutwardsHydraulicBoundaryLocation);
+
+ // Call
+ var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties
+ {
+ Data = context
+ };
+
+ // Assert
+ Assert.AreEqual(id, properties.Id);
+ Assert.AreEqual(name, properties.Name);
+ Point2D coordinates = new Point2D(x, y);
+ Assert.AreEqual(coordinates, properties.Location);
+ Assert.AreEqual(designWaterLevel, properties.DesignWaterLevel, properties.DesignWaterLevel.GetAccuracy());
+ Assert.AreEqual(expectedConvergenceValue, properties.Convergence);
+ }
+
+ [Test]
+ public void PropertyAttributes_ReturnExpectedValues()
+ {
+ // Setup
+ const long id = 1;
+ const double x = 567.0;
+ const double y = 890.0;
+ const string name = "name";
+ var grassCoverErosionOutwardsHydraulicBoundaryLocation = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(
+ new HydraulicBoundaryLocation(id, name, x, y));
+ var locations = new ObservableList
+ {
+ grassCoverErosionOutwardsHydraulicBoundaryLocation
+ };
+ var context = new GrassCoverErosionOutwardsWaterLevelLocationContext(locations, grassCoverErosionOutwardsHydraulicBoundaryLocation);
+
+ var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties
+ {
+ Data = context
+ };
+
+ // Call
+ TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true);
+
+ // Assert
+ var dynamicPropertyBag = new DynamicPropertyBag(properties);
+ PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties();
+ PropertyDescriptor idProperty = dynamicProperties.Find("Id", false);
+ PropertyDescriptor nameProperty = dynamicProperties.Find("Name", false);
+ PropertyDescriptor locationProperty = dynamicProperties.Find("Location", false);
+ PropertyDescriptor waterLevelProperty = dynamicProperties.Find("DesignWaterLevel", false);
+ PropertyDescriptor convergenceProperty = dynamicProperties.Find("Convergence", false);
+
+ Assert.IsInstanceOf(classTypeConverter);
+
+ const string expectedCategory = "Algemeen";
+ const string expectedIdDisplayName = "ID";
+ const string expectedIdDescription = "ID van de hydraulische randvoorwaardenlocatie in de database.";
+ const string expectedNameDisplayName = "Naam";
+ const string expectedNameDescription = "Naam van de hydraulische randvoorwaardenlocatie.";
+ const string expectedLocationDisplayName = "Coördinaten [m]";
+ const string expectedLocationDescription = "Coördinaten van de hydraulische randvoorwaardenlocatie.";
+ const string expectedWaterLevelDisplayName = "Waterstand bij doorsnede-eis [m+NAP]";
+ const string expectedWaterLevelDescription = "Berekende waterstand bij doorsnede-eis.";
+ const string expectedConvergenceDisplayName = "Convergentie";
+ const string expectedConvergenceDescription = "Is convergentie bereikt in de waterstand bij doorsnede-eis berekening?";
+
+ Assert.IsNotNull(idProperty);
+ Assert.IsTrue(idProperty.IsReadOnly);
+ Assert.IsTrue(idProperty.IsBrowsable);
+ Assert.AreEqual(expectedCategory, idProperty.Category);
+ Assert.AreEqual(expectedIdDisplayName, idProperty.DisplayName);
+ Assert.AreEqual(expectedIdDescription, idProperty.Description);
+
+ Assert.IsNotNull(nameProperty);
+ Assert.IsTrue(nameProperty.IsReadOnly);
+ Assert.IsTrue(nameProperty.IsBrowsable);
+ Assert.AreEqual(expectedCategory, nameProperty.Category);
+ Assert.AreEqual(expectedNameDisplayName, nameProperty.DisplayName);
+ Assert.AreEqual(expectedNameDescription, nameProperty.Description);
+
+ Assert.IsNotNull(locationProperty);
+ Assert.IsTrue(locationProperty.IsReadOnly);
+ Assert.IsTrue(locationProperty.IsBrowsable);
+ Assert.AreEqual(expectedCategory, locationProperty.Category);
+ Assert.AreEqual(expectedLocationDisplayName, locationProperty.DisplayName);
+ Assert.AreEqual(expectedLocationDescription, locationProperty.Description);
+
+ Assert.IsNotNull(waterLevelProperty);
+ Assert.IsTrue(waterLevelProperty.IsReadOnly);
+ Assert.IsTrue(waterLevelProperty.IsBrowsable);
+ Assert.AreEqual(expectedCategory, waterLevelProperty.Category);
+ Assert.AreEqual(expectedWaterLevelDisplayName, waterLevelProperty.DisplayName);
+ Assert.AreEqual(expectedWaterLevelDescription, waterLevelProperty.Description);
+
+ Assert.IsNotNull(convergenceProperty);
+ Assert.IsTrue(convergenceProperty.IsReadOnly);
+ Assert.IsTrue(convergenceProperty.IsBrowsable);
+ Assert.AreEqual(expectedCategory, convergenceProperty.Category);
+ Assert.AreEqual(expectedConvergenceDisplayName, convergenceProperty.DisplayName);
+ Assert.AreEqual(expectedConvergenceDescription, convergenceProperty.Description);
+ }
+ }
+}
\ No newline at end of file
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs
===================================================================
diff -u
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs (revision 0)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest.cs (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -0,0 +1,106 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using System.ComponentModel;
+using Core.Common.Base;
+using Core.Common.Base.Data;
+using Core.Common.Gui.Converters;
+using Core.Common.Gui.PropertyBag;
+using NUnit.Framework;
+using Ringtoets.Common.Data.TestUtil;
+using Ringtoets.GrassCoverErosionOutwards.Data;
+using Ringtoets.GrassCoverErosionOutwards.Forms.PropertyClasses;
+using Ringtoets.HydraRing.Data;
+
+namespace Ringtoets.GrassCoverErosionOutwards.Forms.Test.PropertyClasses
+{
+ [TestFixture]
+ public class GrassCoverErosionOutwardsDesignWaterLevelLocationsContextPropertiesTest
+ {
+ [Test]
+ public void DefaultConstructor_ExpectedValues()
+ {
+ // Call
+ var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties();
+
+ // Assert
+ Assert.IsInstanceOf>>(properties);
+ Assert.IsNull(properties.Data);
+ }
+
+ [Test]
+ public void GetProperties_WithData_ReturnExpectedValues()
+ {
+ // Setup
+ RoundedDouble designWaterLevel = (RoundedDouble) 12.34;
+ var location = new GrassCoverErosionOutwardsHydraulicBoundaryLocation(new HydraulicBoundaryLocation(1, "name", 1.0, 2.0))
+ {
+ DesignWaterLevel = designWaterLevel
+ };
+
+ // Call
+ GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties
+ {
+ Data = new ObservableList
+ {
+ location
+ }
+ };
+
+ // Assert
+ Assert.AreEqual(1, properties.Locations.Length);
+
+ GrassCoverErosionOutwardsDesignWaterLevelLocationContextProperties locationProperties = properties.Locations[0];
+ Assert.AreEqual(location.Name, locationProperties.Name);
+ Assert.AreEqual(location.Id, locationProperties.Id);
+ Assert.AreEqual(location.Location, locationProperties.Location);
+ Assert.AreEqual(designWaterLevel, locationProperties.DesignWaterLevel, location.DesignWaterLevel.GetAccuracy());
+ }
+
+ [Test]
+ public void PropertyAttributes_ReturnExpectedValues()
+ {
+ // Setup
+ var properties = new GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties();
+
+ var dynamicPropertyBag = new DynamicPropertyBag(properties);
+ const string expectedLocationsDisplayName = "Locaties";
+ const string expectedLocationsDescription = "Locaties uit de hydraulische randvoorwaardendatabase.";
+ const string expectedLocationsCategory = "Algemeen";
+
+ // Call
+ TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true);
+
+ // Assert
+ PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties();
+ PropertyDescriptor locationsProperty = dynamicProperties.Find("Locations", false);
+
+ Assert.IsInstanceOf(classTypeConverter);
+ Assert.IsNotNull(locationsProperty);
+ Assert.IsInstanceOf(locationsProperty.Converter);
+ Assert.IsTrue(locationsProperty.IsReadOnly);
+ Assert.IsTrue(locationsProperty.IsBrowsable);
+ Assert.AreEqual(expectedLocationsDisplayName, locationsProperty.DisplayName);
+ Assert.AreEqual(expectedLocationsDescription, locationsProperty.Description);
+ Assert.AreEqual(expectedLocationsCategory, locationsProperty.Category);
+ }
+ }
+}
\ No newline at end of file
Fisheye: Tag 4f5e140bd0d2891988a862ff4c5749a7991a12b0 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaterLevelLocationContextPropertiesTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag 4f5e140bd0d2891988a862ff4c5749a7991a12b0 refers to a dead (removed) revision in file `Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaterLevelLocationsContextPropertiesTest.cs'.
Fisheye: No comparison available. Pass `N' to diff?
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsContextPropertiesTest.cs
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextPropertiesTest.cs) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/PropertyClasses/GrassCoverErosionOutwardsWaveHeightLocationsContextPropertiesTest.cs (.../GrassCoverErosionOutwardsWaveHeightLocationsContextPropertiesTest.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -71,9 +71,9 @@
Assert.AreEqual(1, properties.Locations.Length);
GrassCoverErosionOutwardsWaveHeightLocationContextProperties designWaterLevelLocationProperties = properties.Locations.First();
- Assert.AreEqual(location.HydraulicBoundaryLocation.Name, designWaterLevelLocationProperties.Name);
- Assert.AreEqual(location.HydraulicBoundaryLocation.Id, designWaterLevelLocationProperties.Id);
- Assert.AreEqual(location.HydraulicBoundaryLocation.Location, designWaterLevelLocationProperties.Location);
+ Assert.AreEqual(location.Name, designWaterLevelLocationProperties.Name);
+ Assert.AreEqual(location.Id, designWaterLevelLocationProperties.Id);
+ Assert.AreEqual(location.Location, designWaterLevelLocationProperties.Location);
Assert.AreEqual(waveHeight, designWaterLevelLocationProperties.WaveHeight, location.WaveHeight.GetAccuracy());
Assert.AreEqual("Nee", designWaterLevelLocationProperties.Convergence);
}
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Forms.Test/Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj (.../Ringtoets.GrassCoverErosionOutwards.Forms.Test.csproj) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -57,21 +57,21 @@
Properties\GlobalAssembly.cs
-
-
+
+
-
-
-
-
+
+
+
+
Index: Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs
===================================================================
diff -u -r84e2f073c0cc2484a97dd47c452761c05d93aa97 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 84e2f073c0cc2484a97dd47c452761c05d93aa97)
+++ Ringtoets/GrassCoverErosionOutwards/test/Ringtoets.GrassCoverErosionOutwards.Plugin.Test/GrassCoverErosionOutwardsPluginTest.cs (.../GrassCoverErosionOutwardsPluginTest.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -107,10 +107,10 @@
var waterLevelHydraulicBoundaryLocationsContextProperties = PluginTestHelper.AssertPropertyInfoDefined<
GrassCoverErosionOutwardsWaterLevelLocationsContext,
- GrassCoverErosionOutwardsWaterLevelLocationsContextProperties>(propertyInfos);
+ GrassCoverErosionOutwardsDesignWaterLevelLocationsContextProperties>(propertyInfos);
Assert.IsNull(waterLevelHydraulicBoundaryLocationsContextProperties.AdditionalDataCheck);
Assert.IsNull(waterLevelHydraulicBoundaryLocationsContextProperties.AfterCreate);
-
+
var waveHeightLocationContextProperties = PluginTestHelper.AssertPropertyInfoDefined<
GrassCoverErosionOutwardsWaveHeightLocationsContext,
GrassCoverErosionOutwardsWaveHeightLocationsContextProperties>(propertyInfos);
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs
===================================================================
diff -u -r1a74778bb0981ce2bcc6ca7aba097831365bbb24 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 1a74778bb0981ce2bcc6ca7aba097831365bbb24)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -20,17 +20,15 @@
// All rights reserved.
using System;
-using Core.Common.Base;
using Core.Common.Base.Data;
using Core.Common.Base.Geometry;
-using Core.Common.Base.Storage;
namespace Ringtoets.HydraRing.Data
{
///
/// Location of a hydraulic boundary.
///
- public class HydraulicBoundaryLocation : Observable, IStorable
+ public class HydraulicBoundaryLocation : IHydraulicBoundaryLocation
{
private RoundedDouble designWaterLevel;
private RoundedDouble waveHeight;
@@ -57,21 +55,6 @@
}
///
- /// Gets the database id of .
- ///
- public long Id { get; private set; }
-
- ///
- /// Gets the name of .
- ///
- public string Name { get; private set; }
-
- ///
- /// Gets the coordinates of .
- ///
- public Point2D Location { get; private set; }
-
- ///
/// Gets or sets the design water level of .
///
public RoundedDouble DesignWaterLevel
@@ -111,6 +94,12 @@
///
public CalculationConvergence WaveHeightCalculationConvergence { get; set; }
+ public long Id { get; private set; }
+
+ public string Name { get; private set; }
+
+ public Point2D Location { get; private set; }
+
///
/// Gets or sets the unique identifier for the storage of the class.
///
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs
===================================================================
diff -u
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs (revision 0)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/IHydraulicBoundaryLocation.cs (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -0,0 +1,47 @@
+// Copyright (C) Stichting Deltares 2016. All rights reserved.
+//
+// This file is part of Ringtoets.
+//
+// Ringtoets is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+//
+// All names, logos, and references to "Deltares" are registered trademarks of
+// Stichting Deltares and remain full property of Stichting Deltares at all times.
+// All rights reserved.
+
+using Core.Common.Base.Geometry;
+using Core.Common.Base.Storage;
+
+namespace Ringtoets.HydraRing.Data
+{
+ ///
+ /// Interface for an object for which a hydraulic boundary location can be stored.
+ ///
+ public interface IHydraulicBoundaryLocation : IStorable
+ {
+ ///
+ /// Gets the database id of .
+ ///
+ long Id { get; }
+
+ ///
+ /// Gets the name of .
+ ///
+ string Name { get; }
+
+ ///
+ /// Gets the coordinates of .
+ ///
+ Point2D Location { get; }
+ }
+}
\ No newline at end of file
Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/Ringtoets.HydraRing.Data.csproj
===================================================================
diff -u -r6f1e2e16c67292603f19489965183fa7176ff6af -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/Ringtoets.HydraRing.Data.csproj (.../Ringtoets.HydraRing.Data.csproj) (revision 6f1e2e16c67292603f19489965183fa7176ff6af)
+++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/Ringtoets.HydraRing.Data.csproj (.../Ringtoets.HydraRing.Data.csproj) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -42,6 +42,7 @@
+ True
Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs
===================================================================
diff -u -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 -r4f5e140bd0d2891988a862ff4c5749a7991a12b0
--- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805)
+++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 4f5e140bd0d2891988a862ff4c5749a7991a12b0)
@@ -20,7 +20,6 @@
// All rights reserved.
using System;
-using Core.Common.Base;
using Core.Common.Base.Geometry;
using NUnit.Framework;
@@ -52,8 +51,7 @@
HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y);
// Assert
- Assert.IsInstanceOf(hydraulicBoundaryLocation);
- Assert.IsInstanceOf(hydraulicBoundaryLocation);
+ Assert.IsInstanceOf(hydraulicBoundaryLocation);
Assert.AreEqual(id, hydraulicBoundaryLocation.Id);
Assert.AreEqual(name, hydraulicBoundaryLocation.Name);
Point2D location = hydraulicBoundaryLocation.Location;