Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs =================================================================== diff -u -r41960c7d3d923a60575133a585d4cecfb1a251b5 -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision 41960c7d3d923a60575133a585d4cecfb1a251b5) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Data/DikeProfile.cs (.../DikeProfile.cs) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -23,7 +23,6 @@ using System.Collections.Generic; using Core.Common.Base.Data; using Core.Common.Base.Geometry; - using Ringtoets.GrassCoverErosionInwards.Data.Properties; namespace Ringtoets.GrassCoverErosionInwards.Data @@ -153,5 +152,10 @@ dikeHeight = value.ToPrecision(dikeHeight.NumberOfDecimalPlaces); } } + + public override string ToString() + { + return Name; + } } } \ No newline at end of file Index: Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs =================================================================== diff -u -r41960c7d3d923a60575133a585d4cecfb1a251b5 -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 41960c7d3d923a60575133a585d4cecfb1a251b5) +++ Ringtoets/GrassCoverErosionInwards/test/Ringtoets.GrassCoverErosionInwards.Data.Test/DikeProfileTest.cs (.../DikeProfileTest.cs) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -203,5 +203,22 @@ // Assert Assert.IsTrue(hasBreakWater); } + + [Test] + public void ToString_Always_ReturnsName() + { + // Setup + var testName = "testName"; + var dikeProfile = new DikeProfile(new Point2D(0, 0)) + { + Name = testName + }; + + // Call + var result = dikeProfile.ToString(); + + // Assert + Assert.AreEqual(testName, result); + } } } \ No newline at end of file Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs =================================================================== diff -u -r1395d3e2c0a6df5b27da3a44c820ca90eab3492c -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 1395d3e2c0a6df5b27da3a44c820ca90eab3492c) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -20,13 +20,9 @@ // All rights reserved. using System; -using System.ComponentModel; using Core.Common.Base; using Core.Common.Base.Geometry; -using Core.Common.Gui.Converters; -using Core.Common.Gui.PropertyBag; using NUnit.Framework; -using Ringtoets.Integration.Forms.PropertyClasses; namespace Ringtoets.HydraRing.Data.Test { @@ -81,54 +77,14 @@ } [Test] - public void PropertyAttributes_ReturnExpectedValues() - { - // Setup - var hydraulicBoundaryLocationProperties = new HydraulicBoundaryDatabaseProperties(); - - var dynamicPropertyBag = new DynamicPropertyBag(hydraulicBoundaryLocationProperties); - const string expectedFilePathDisplayName = "Hydraulische randvoorwaarden database"; - const string expectedFilePathDescription = "Locatie van het hydraulische randvoorwaarden database bestand."; - const string expectedFilePathCategory = "Algemeen"; - - const string expectedLocationsDisplayName = "Locaties"; - const string expectedLocationsDescription = "Locaties uit de hydraulische randvoorwaarden database."; - const string expectedLocationsCategory = "Algemeen"; - - // Call - TypeConverter classTypeConverter = TypeDescriptor.GetConverter(hydraulicBoundaryLocationProperties, true); - PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); - PropertyDescriptor filePathProperty = dynamicProperties.Find("FilePath", false); - PropertyDescriptor locationsProperty = dynamicProperties.Find("Locations", false); - - // Assert - Assert.IsInstanceOf(classTypeConverter); - - Assert.IsNotNull(filePathProperty); - Assert.IsTrue(filePathProperty.IsReadOnly); - Assert.IsTrue(filePathProperty.IsBrowsable); - Assert.AreEqual(expectedFilePathDisplayName, filePathProperty.DisplayName); - Assert.AreEqual(expectedFilePathDescription, filePathProperty.Description); - Assert.AreEqual(expectedFilePathCategory, filePathProperty.Category); - - 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, filePathProperty.Category); - } - - [Test] public void ToString_Always_ReturnsName() { // Setup var testName = "testName"; - var hydraulicBoundaryLocationProperties = new HydraulicBoundaryLocation(0, testName, 0, 0); + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, testName, 0, 0); // Call - var result = hydraulicBoundaryLocationProperties.ToString(); + var result = hydraulicBoundaryLocation.ToString(); // Assert Assert.AreEqual(testName, result); Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/Ringtoets.HydraRing.Data.Test.csproj =================================================================== diff -u -r2ad324afda61327592af1226a9d8d3de01b614be -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/Ringtoets.HydraRing.Data.Test.csproj (.../Ringtoets.HydraRing.Data.Test.csproj) (revision 2ad324afda61327592af1226a9d8d3de01b614be) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/Ringtoets.HydraRing.Data.Test.csproj (.../Ringtoets.HydraRing.Data.Test.csproj) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -58,14 +58,6 @@ {3BBFD65B-B277-4E50-AE6D-BD24C3434609} Core.Common.Base - - {30E4C2AE-719E-4D70-9FA9-668A9767FBFA} - Core.Common.Gui - - - {AD0CDC89-0A00-4068-AEEC-9838863C2FE8} - Ringtoets.Integration.Forms - {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} Ringtoets.HydraRing.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs =================================================================== diff -u -r63fbdd5525927fbf9d63925eef9da8e17a0d7b44 -r5f0c498962317723017cf965a142e7cf4e67a915 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision 63fbdd5525927fbf9d63925eef9da8e17a0d7b44) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision 5f0c498962317723017cf965a142e7cf4e67a915) @@ -19,7 +19,9 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System.ComponentModel; using System.Linq; +using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using NUnit.Framework; using Rhino.Mocks; @@ -77,5 +79,45 @@ Assert.AreEqual(expectedLocationProperties.Location, hydraulicBoundaryLocationProperties.Location); Assert.AreEqual(expectedLocationProperties.DesignWaterLevel, hydraulicBoundaryLocationProperties.DesignWaterLevel); } + + [Test] + public void PropertyAttributes_ReturnExpectedValues() + { + // Setup + var hydraulicBoundaryLocationProperties = new HydraulicBoundaryDatabaseProperties(); + + var dynamicPropertyBag = new DynamicPropertyBag(hydraulicBoundaryLocationProperties); + const string expectedFilePathDisplayName = "Hydraulische randvoorwaarden database"; + const string expectedFilePathDescription = "Locatie van het hydraulische randvoorwaarden database bestand."; + const string expectedFilePathCategory = "Algemeen"; + + const string expectedLocationsDisplayName = "Locaties"; + const string expectedLocationsDescription = "Locaties uit de hydraulische randvoorwaarden database."; + const string expectedLocationsCategory = "Algemeen"; + + // Call + TypeConverter classTypeConverter = TypeDescriptor.GetConverter(hydraulicBoundaryLocationProperties, true); + PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); + PropertyDescriptor filePathProperty = dynamicProperties.Find("FilePath", false); + PropertyDescriptor locationsProperty = dynamicProperties.Find("Locations", false); + + // Assert + Assert.IsInstanceOf(classTypeConverter); + + Assert.IsNotNull(filePathProperty); + Assert.IsTrue(filePathProperty.IsReadOnly); + Assert.IsTrue(filePathProperty.IsBrowsable); + Assert.AreEqual(expectedFilePathDisplayName, filePathProperty.DisplayName); + Assert.AreEqual(expectedFilePathDescription, filePathProperty.Description); + Assert.AreEqual(expectedFilePathCategory, filePathProperty.Category); + + 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, filePathProperty.Category); + } } } \ No newline at end of file