Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsContextProperties.cs =================================================================== diff -u -r7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsContextProperties.cs (.../DesignWaterLevelLocationsContextProperties.cs) (revision 7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationsContextProperties.cs (.../DesignWaterLevelLocationsContextProperties.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -45,12 +45,10 @@ { get { - return data != null - ? data.Locations.Select(loc => new HydraulicBoundaryLocationDesignWaterLevelProperties - { - Data = loc - }).ToArray() - : new HydraulicBoundaryLocationDesignWaterLevelProperties[0]; + return data.Locations.Select(loc => new HydraulicBoundaryLocationDesignWaterLevelProperties + { + Data = loc + }).ToArray(); } } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationProperties.cs (.../HydraulicBoundaryLocationProperties.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -21,27 +21,25 @@ using System.ComponentModel; using Core.Common.Base.Geometry; -using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Data.Properties; using Ringtoets.HydraRing.Data; -using Ringtoets.Integration.Forms.Properties; namespace Ringtoets.Integration.Forms.PropertyClasses { /// /// ViewModel of for properties panel. /// [TypeConverter(typeof(ExpandableObjectConverter))] - public class HydraulicBoundaryLocationProperties : ObjectProperties + public abstract class HydraulicBoundaryLocationProperties : ObjectProperties { /// /// Gets the . /// - [PropertyOrder(1)] - [ResourcesCategory(typeof(Common.Data.Properties.Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Id_DisplayName")] - [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Id_Description")] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Id_DisplayName")] + [ResourcesDescription(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Id_Description")] public virtual long Id { get @@ -53,10 +51,9 @@ /// /// Gets the . /// - [PropertyOrder(2)] - [ResourcesCategory(typeof(Common.Data.Properties.Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Name_DisplayName")] - [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Name_Description")] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Name_DisplayName")] + [ResourcesDescription(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Name_Description")] public virtual string Name { get @@ -68,10 +65,9 @@ /// /// Gets the . /// - [PropertyOrder(3)] - [ResourcesCategory(typeof(Common.Data.Properties.Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_DisplayName")] - [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_Description")] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_DisplayName")] + [ResourcesDescription(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_Coordinates_Description")] public virtual Point2D Location { get Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs =================================================================== diff -u -r2eddebcc1427cfc1d806fdb8c6bce6b5f9df6bde -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs (.../HydraulicBoundaryLocationWaveHeightProperties.cs) (revision 2eddebcc1427cfc1d806fdb8c6bce6b5f9df6bde) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/HydraulicBoundaryLocationWaveHeightProperties.cs (.../HydraulicBoundaryLocationWaveHeightProperties.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -19,12 +19,12 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using System.Globalization; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Gui.Attributes; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Data.Properties; using Ringtoets.HydraRing.Data; -using Ringtoets.Integration.Forms.Properties; namespace Ringtoets.Integration.Forms.PropertyClasses { @@ -64,24 +64,24 @@ /// Gets the . /// [PropertyOrder(4)] - [ResourcesCategory(typeof(Common.Data.Properties.Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Locations_WaveHeight_DisplayName")] - [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Locations_WaveHeight_Description")] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_WaveHeight_DisplayName")] + [ResourcesDescription(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Locations_WaveHeight_Description")] public string WaveHeight { get { - return double.IsNaN(data.WaveHeight) ? string.Empty : data.WaveHeight.ToString("F2", CultureInfo.InvariantCulture); + return double.IsNaN(data.WaveHeight) ? string.Empty : new RoundedDouble(2, data.WaveHeight).ToString(); } } /// /// Gets the convergence status of the waveheight calculation. /// [PropertyOrder(5)] - [ResourcesCategory(typeof(Common.Data.Properties.Resources), "Categories_General")] - [ResourcesDisplayName(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_DisplayName")] - [ResourcesDescription(typeof(Resources), "HydraulicBoundaryDatabase_Convergence_WaveHeight_Description")] + [ResourcesCategory(typeof(Resources), "Categories_General")] + [ResourcesDisplayName(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Convergence_DisplayName")] + [ResourcesDescription(typeof(Properties.Resources), "HydraulicBoundaryDatabase_Convergence_WaveHeight_Description")] public bool Convergence { get Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightContextProperties.cs =================================================================== diff -u -r7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightContextProperties.cs (.../WaveHeightContextProperties.cs) (revision 7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightContextProperties.cs (.../WaveHeightContextProperties.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -45,12 +45,10 @@ { get { - return data != null - ? data.Locations.Select(loc => new HydraulicBoundaryLocationWaveHeightProperties - { - Data = loc - }).ToArray() - : new HydraulicBoundaryLocationWaveHeightProperties[0]; + return data.Locations.Select(loc => new HydraulicBoundaryLocationWaveHeightProperties + { + Data = loc + }).ToArray(); } } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs =================================================================== diff -u -r7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs (.../DesignWaterLevelLocationsContextPropertiesTest.cs) (revision 7cb21cb8c5e2a67bf24b9e2858ef861a15ee537e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs (.../DesignWaterLevelLocationsContextPropertiesTest.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -20,15 +20,12 @@ // All rights reserved. using System.ComponentModel; -using System.Globalization; using System.Linq; +using Core.Common.Base.Data; using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using NUnit.Framework; -using Rhino.Mocks; -using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.HydraRing.Data; -using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; namespace Ringtoets.Integration.Forms.Test.PropertyClasses @@ -51,25 +48,14 @@ public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var mockRepository = new MockRepository(); - var assessmentSectionMock = mockRepository.Stub(); - mockRepository.ReplayAll(); - HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - DesignWaterLevelLocationsContext designWaterLevelLocationsContext = new DesignWaterLevelLocationsContext(assessmentSectionMock) - { - WrappedData = - { - HydraulicBoundaryDatabase = hydraulicBoundaryDatabase - } - }; const double designWaterLevel = 12.34; HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0) { DesignWaterLevel = designWaterLevel }; - designWaterLevelLocationsContext.WrappedData.HydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); + hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); // Call DesignWaterLevelLocationsContextProperties properties = new DesignWaterLevelLocationsContextProperties @@ -85,9 +71,8 @@ Assert.AreEqual(hydraulicBoundaryLocation.Name, designWaterLevelLocationProperties.Name); Assert.AreEqual(hydraulicBoundaryLocation.Id, designWaterLevelLocationProperties.Id); Assert.AreEqual(hydraulicBoundaryLocation.Location, designWaterLevelLocationProperties.Location); - var expectedDesignWaterLevelValue = designWaterLevel.ToString("F2", CultureInfo.InvariantCulture); + var expectedDesignWaterLevelValue = new RoundedDouble(2, designWaterLevel).ToString(); Assert.AreEqual(expectedDesignWaterLevelValue, designWaterLevelLocationProperties.DesignWaterLevel); - mockRepository.VerifyAll(); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs =================================================================== diff -u -r9663b036afafe1a23c75ade5af7318830c10d408 -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision 9663b036afafe1a23c75ade5af7318830c10d408) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryLocationPropertiesTest.cs (.../HydraulicBoundaryLocationPropertiesTest.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -50,7 +50,7 @@ mockRepository.ReplayAll(); // Call - TestDelegate test = () => new HydraulicBoundaryLocationProperties + TestDelegate test = () => new TestHydraulicBoundaryLocationProperties { Data = hydraulicBoundaryLocationMock }; @@ -64,18 +64,18 @@ public void GetProperties_ValidData_ReturnsExpectedValues() { // Setup - long id = 1234L; - double x = 567.0; - double y = 890.0; + const long id = 1234L; + const double x = 567.0; + const double y = 890.0; Point2D coordinates = new Point2D(x, y); - string name = ""; + const string name = ""; var mockRepository = new MockRepository(); var hydraulicBoundaryLocationMock = mockRepository.StrictMock(id, name, x, y); mockRepository.ReplayAll(); // Call - HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties { Data = hydraulicBoundaryLocationMock }; @@ -93,9 +93,9 @@ public void ToString_WithName_ReturnsName(string name) { // Setup - long id = 1234L; - double x = 567.0; - double y = 890.0; + const long id = 1234L; + const double x = 567.0; + const double y = 890.0; var mockRepository = new MockRepository(); object[] hydraulicBoundaryLocationArguments = { @@ -110,7 +110,7 @@ var expectedString = string.Format("{0} {1}", name, new Point2D(x, y)); // Call - HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties + HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties { Data = hydraulicBoundaryLocationMock }; @@ -127,7 +127,7 @@ var hydraulicBoundaryLocationMock = mockRepository.StrictMock(0, "", 0.0, 0.0); mockRepository.ReplayAll(); - var hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocationProperties + var hydraulicBoundaryLocationProperties = new TestHydraulicBoundaryLocationProperties { Data = hydraulicBoundaryLocationMock }; @@ -158,25 +158,24 @@ Assert.AreEqual(expectedCategory, idProperty.Category); Assert.AreEqual(expectedIdDisplayName, idProperty.DisplayName); Assert.AreEqual(expectedIdDescription, idProperty.Description); - Assert.AreEqual(1, idProperty.Attributes.OfType().First().Order); 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.AreEqual(2, nameProperty.Attributes.OfType().First().Order); 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.AreEqual(3, locationProperty.Attributes.OfType().First().Order); mockRepository.VerifyAll(); } + + private class TestHydraulicBoundaryLocationProperties : HydraulicBoundaryLocationProperties {} } } \ No newline at end of file Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj =================================================================== diff -u -r718348fd1a88ab775f495dad750379e4cbedb25f -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision 718348fd1a88ab775f495dad750379e4cbedb25f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Ringtoets.Integration.Forms.Test.csproj (.../Ringtoets.Integration.Forms.Test.csproj) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -93,7 +93,6 @@ - Fisheye: Tag bf4509c4766e79ae2785d4b4dc875cbdb781856c refers to a dead (removed) revision in file `Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationContextTreeNodeInfoTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs =================================================================== diff -u -r7d12b4b34fc1d160cf0aeab237b1b41a4f037aac -rbf4509c4766e79ae2785d4b4dc875cbdb781856c --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision 7d12b4b34fc1d160cf0aeab237b1b41a4f037aac) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs (.../HydraulicBoundaryDatabaseContextTreeNodeInfoTest.cs) (revision bf4509c4766e79ae2785d4b4dc875cbdb781856c) @@ -217,11 +217,10 @@ var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection); - mocks.ReplayAll(); - using (var plugin = new RingtoetsPlugin()) { var info = GetInfo(plugin); + // Call var objects = info.ChildNodeObjects(hydraulicBoundaryDatabaseContext).ToArray(); @@ -241,11 +240,10 @@ var hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSection); - mocks.ReplayAll(); - using (var plugin = new RingtoetsPlugin()) { var info = GetInfo(plugin); + // Call var objects = info.ChildNodeObjects(hydraulicBoundaryDatabaseContext).ToArray();