Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/CalculationConvergenceTest.cs =================================================================== diff -u -r9797c9d215a710475c415fb3864e5c3a0d420ae0 -r4eb3b5296acb1944201b09eb87e26584ec473b33 --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/CalculationConvergenceTest.cs (.../CalculationConvergenceTest.cs) (revision 9797c9d215a710475c415fb3864e5c3a0d420ae0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Hydraulics/CalculationConvergenceTest.cs (.../CalculationConvergenceTest.cs) (revision 4eb3b5296acb1944201b09eb87e26584ec473b33) @@ -1,4 +1,25 @@ -using Core.Common.Utils.Attributes; +// 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.Utils.Attributes; using NUnit.Framework; using Ringtoets.Common.Data.Hydraulics; Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationProperties.cs =================================================================== diff -u -r9696877b8e90de7c28ac96e336d3f9db28b02118 -r4eb3b5296acb1944201b09eb87e26584ec473b33 --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationProperties.cs (.../DuneLocationProperties.cs) (revision 9696877b8e90de7c28ac96e336d3f9db28b02118) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Forms/PropertyClasses/DuneLocationProperties.cs (.../DuneLocationProperties.cs) (revision 4eb3b5296acb1944201b09eb87e26584ec473b33) @@ -97,6 +97,7 @@ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Result")] [ResourcesDisplayName(typeof(Resources), "DuneLocation_WaterLevel_DisplayName")] [ResourcesDescription(typeof(Resources), "DuneLocation_WaterLevel_Description")] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] public RoundedDouble WaterLevel { get @@ -110,6 +111,7 @@ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Result")] [ResourcesDisplayName(typeof(Resources), "DuneLocation_WaveHeight_DisplayName")] [ResourcesDescription(typeof(Resources), "DuneLocation_WaveHeight_Description")] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] public RoundedDouble WaveHeight { get @@ -123,6 +125,7 @@ [ResourcesCategory(typeof(RingtoetsCommonFormsResources), "Categories_Result")] [ResourcesDisplayName(typeof(Resources), "DuneLocation_WavePeriod_DisplayName")] [ResourcesDescription(typeof(Resources), "DuneLocation_WavePeriod_Description")] + [TypeConverter(typeof(NoValueRoundedDoubleConverter))] public RoundedDouble WavePeriod { get @@ -204,7 +207,7 @@ public override string ToString() { - return string.Empty; + return string.Format("{0} {1}", Name, Location); } } } \ No newline at end of file Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs =================================================================== diff -u -r53899e3aa398c52ec6d618cc030aea5c5acd1f0f -r4eb3b5296acb1944201b09eb87e26584ec473b33 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs (.../DuneLocationPropertiesTest.cs) (revision 53899e3aa398c52ec6d618cc030aea5c5acd1f0f) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Forms.Test/PropertyClasses/DuneLocationPropertiesTest.cs (.../DuneLocationPropertiesTest.cs) (revision 4eb3b5296acb1944201b09eb87e26584ec473b33) @@ -1,7 +1,6 @@ using System; using System.ComponentModel; using Core.Common.Base.Geometry; -using Core.Common.Gui.PropertyBag; using Core.Common.TestUtil; using Core.Common.Utils; using Core.Common.Utils.Reflection; @@ -84,11 +83,12 @@ const double x = 567.0; const double y = 890.0; const string name = ""; - const int coastalAreaId = 1337; - + var random = new Random(); + int coastalAreaId = random.Next(); double offset = random.NextDouble(); double orientation = random.NextDouble(); + double d50 = random.NextDouble(); double waterLevel = random.NextDouble(); double waveHeight = random.NextDouble(); double wavePeriod = random.NextDouble(); @@ -99,7 +99,7 @@ var output = new DuneLocationOutput(waterLevel, waveHeight, wavePeriod, targetProbability, targetReliability, calculatedProbability, calculatedReliability, convergence); - var location = new DuneLocation(id, name, new Point2D(x, y), coastalAreaId, offset, orientation, random.NextDouble()) + var location = new DuneLocation(id, name, new Point2D(x, y), coastalAreaId, offset, orientation, d50) { Output = output }; @@ -114,8 +114,7 @@ Assert.AreEqual(id, properties.Id); Assert.AreEqual(name, properties.Name); Assert.AreEqual(coastalAreaId, properties.CoastalAreaId); - Assert.AreEqual(1, location.Offset.NumberOfDecimalPlaces); - Assert.AreEqual(location.Offset, properties.Offset); + Assert.AreEqual(location.Offset, properties.Offset, properties.Offset.GetAccuracy()); var expectedLocation = new Point2D(x, y); Assert.AreEqual(expectedLocation, properties.Location); @@ -146,13 +145,8 @@ // Assert TypeConverter classTypeConverter = TypeDescriptor.GetConverter(properties, true); - var propertyBag = new DynamicPropertyBag(properties); - - PropertyDescriptorCollection dynamicProperties = propertyBag.GetProperties(new Attribute[] - { - new BrowsableAttribute(true) - }); - + + PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(13, dynamicProperties.Count); Assert.IsInstanceOf(classTypeConverter); Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneLocationsContextPropertyInfoTest.cs =================================================================== diff -u -r3d1365e8ec250bc6e93c923736635a049a7facec -r4eb3b5296acb1944201b09eb87e26584ec473b33 --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneLocationsContextPropertyInfoTest.cs (.../DuneLocationsContextPropertyInfoTest.cs) (revision 3d1365e8ec250bc6e93c923736635a049a7facec) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/PropertyInfos/DuneLocationsContextPropertyInfoTest.cs (.../DuneLocationsContextPropertyInfoTest.cs) (revision 4eb3b5296acb1944201b09eb87e26584ec473b33) @@ -1,4 +1,25 @@ -using System.Linq; +// 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.Linq; using Core.Common.Gui.Plugin; using NUnit.Framework; using Rhino.Mocks; @@ -28,10 +49,10 @@ } [Test] - public void CreateInstance_Always_SetsHydraulicBoundaryLocationsAsData() + public void CreateInstance_Always_SetsDuneLocationsAsData() { // Setup - MockRepository mockRepository = new MockRepository(); + var mockRepository = new MockRepository(); var assessmentSection = mockRepository.Stub(); mockRepository.ReplayAll();