Index: Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationEntityReadExtensions.cs =================================================================== diff -u -r05013c44d1273bac219a442dc7959706c6bac715 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationEntityReadExtensions.cs (.../HydraulicLocationEntityReadExtensions.cs) (revision 05013c44d1273bac219a442dc7959706c6bac715) +++ Application/Ringtoets/src/Application.Ringtoets.Storage/Read/HydraulicLocationEntityReadExtensions.cs (.../HydraulicLocationEntityReadExtensions.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -21,6 +21,7 @@ using System; using Application.Ringtoets.Storage.DbContext; +using Core.Common.Base.Data; using Ringtoets.HydraRing.Data; namespace Application.Ringtoets.Storage.Read @@ -57,16 +58,9 @@ StorageId = entity.HydraulicLocationEntityId }; - if (entity.DesignWaterLevel.HasValue) - { - hydraulicBoundaryLocation.DesignWaterLevel = entity.DesignWaterLevel.Value; - } + hydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) entity.DesignWaterLevel.ToNullAsNaN(); + hydraulicBoundaryLocation.WaveHeight = (RoundedDouble) entity.WaveHeight.ToNullAsNaN(); - if (entity.WaveHeight.HasValue) - { - hydraulicBoundaryLocation.WaveHeight = entity.WaveHeight.Value; - } - hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = (CalculationConvergence) entity.DesignWaterLevelCalculationConvergence; Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs =================================================================== diff -u -r05013c44d1273bac219a442dc7959706c6bac715 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCreateExtensionsTest.cs) (revision 05013c44d1273bac219a442dc7959706c6bac715) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Create/HydraulicBoundaryLocationCreateExtensionsTest.cs (.../HydraulicBoundaryLocationCreateExtensionsTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,7 +22,9 @@ using System; using Application.Ringtoets.Storage.Create; using Application.Ringtoets.Storage.DbContext; +using Core.Common.Base.Data; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; namespace Application.Ringtoets.Storage.Test.Create @@ -94,8 +96,8 @@ { // Setup var random = new Random(21); - var waterLevel = random.NextDouble(); - var waveHeight = random.NextDouble(); + var waterLevel = (RoundedDouble) random.NextDouble(); + var waveHeight = (RoundedDouble) random.NextDouble(); var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(-1, "testName", random.NextDouble(), random.NextDouble()) { DesignWaterLevel = waterLevel, @@ -110,8 +112,8 @@ // Assert Assert.IsNotNull(entity); - Assert.AreEqual(waterLevel, entity.DesignWaterLevel); - Assert.AreEqual(waveHeight, entity.WaveHeight); + Assert.AreEqual(waterLevel, entity.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); + Assert.AreEqual(waveHeight, entity.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); Assert.AreEqual(CalculationConvergence.CalculatedConverged, (CalculationConvergence) entity.DesignWaterLevelCalculationConvergence); Assert.AreEqual(CalculationConvergence.CalculatedConverged, (CalculationConvergence) entity.WaveHeightCalculationConvergence); } Index: Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/HydraulicLocationEntityReadExtensionsTest.cs =================================================================== diff -u -r05013c44d1273bac219a442dc7959706c6bac715 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/HydraulicLocationEntityReadExtensionsTest.cs (.../HydraulicLocationEntityReadExtensionsTest.cs) (revision 05013c44d1273bac219a442dc7959706c6bac715) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.Test/Read/HydraulicLocationEntityReadExtensionsTest.cs (.../HydraulicLocationEntityReadExtensionsTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,7 +22,9 @@ using System; using Application.Ringtoets.Storage.DbContext; using Application.Ringtoets.Storage.Read; +using Core.Common.Base.Data; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; namespace Application.Ringtoets.Storage.Test.Read @@ -105,7 +107,7 @@ // Assert Assert.IsNotNull(location); - Assert.AreEqual(expectedWaterLevel, location.DesignWaterLevel); + Assert.AreEqual((RoundedDouble) expectedWaterLevel, location.DesignWaterLevel, location.DesignWaterLevel.GetAccuracy()); } [Test] @@ -130,7 +132,7 @@ // Assert Assert.IsNotNull(location); - Assert.AreEqual(expectedWaveHeight, location.WaveHeight); + Assert.AreEqual((RoundedDouble) expectedWaveHeight, location.WaveHeight, location.WaveHeight.GetAccuracy()); } [Test] Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj =================================================================== diff -u -r05013c44d1273bac219a442dc7959706c6bac715 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision 05013c44d1273bac219a442dc7959706c6bac715) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/Application.Ringtoets.Storage.TestUtil.Test.csproj (.../Application.Ringtoets.Storage.TestUtil.Test.csproj) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -93,6 +93,10 @@ {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {70f8cc9c-5bc8-4fb2-b201-eae7fa8088c2} Ringtoets.HydraRing.Data Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs =================================================================== diff -u -r6f1e2e16c67292603f19489965183fa7176ff6af -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 6f1e2e16c67292603f19489965183fa7176ff6af) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil.Test/RingtoetsProjectTestHelperTest.cs (.../RingtoetsProjectTestHelperTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -20,8 +20,10 @@ // All rights reserved. using System.Linq; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Piping.Data; @@ -47,7 +49,8 @@ string locationName = "test"; double locationX = 152.3; double locationY = 2938.5; - double designWaterLevel = 12.4; + RoundedDouble designWaterLevel = (RoundedDouble) 12.4; + RoundedDouble waveHeight = (RoundedDouble) 2.4; // Call RingtoetsProject project = RingtoetsProjectTestHelper.GetFullTestProject(); @@ -70,7 +73,8 @@ Assert.AreEqual(locationName, hydraulicBoundaryLocation.Name); Assert.AreEqual(locationX, hydraulicBoundaryLocation.Location.X); Assert.AreEqual(locationY, hydraulicBoundaryLocation.Location.Y); - Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); + Assert.AreEqual(waveHeight, hydraulicBoundaryLocation.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); Index: Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs =================================================================== diff -u -r05013c44d1273bac219a442dc7959706c6bac715 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 05013c44d1273bac219a442dc7959706c6bac715) +++ Application/Ringtoets/test/Application.Ringtoets.Storage.TestUtil/RingtoetsProjectTestHelper.cs (.../RingtoetsProjectTestHelper.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -639,7 +639,8 @@ }; hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(13001, "test", 152.3, 2938.5) { - DesignWaterLevel = 12.4, + DesignWaterLevel = (RoundedDouble) 12.4, + WaveHeight = (RoundedDouble) 2.4, DesignWaterLevelCalculationConvergence = CalculationConvergence.NotCalculated, WaveHeightCalculationConvergence = CalculationConvergence.NotCalculated }); Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -rae99d19be5c1bd59e6cc85669c96a3b9895e660d -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision ae99d19be5c1bd59e6cc85669c96a3b9895e660d) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -201,24 +201,24 @@ private void SetHydraulicBoundaryLocationDesignWaterLevelValues(ICollection locations) { - locations.ElementAt(0).DesignWaterLevel = 5.78; - locations.ElementAt(1).DesignWaterLevel = 5.77; - locations.ElementAt(2).DesignWaterLevel = 5.77; - locations.ElementAt(3).DesignWaterLevel = 5.77; - locations.ElementAt(4).DesignWaterLevel = 5.77; - locations.ElementAt(5).DesignWaterLevel = 5.93; - locations.ElementAt(6).DesignWaterLevel = 5.93; - locations.ElementAt(7).DesignWaterLevel = 5.93; - locations.ElementAt(8).DesignWaterLevel = 5.93; - locations.ElementAt(9).DesignWaterLevel = 5.93; - locations.ElementAt(10).DesignWaterLevel = 5.93; - locations.ElementAt(11).DesignWaterLevel = 5.93; - locations.ElementAt(12).DesignWaterLevel = 5.93; - locations.ElementAt(13).DesignWaterLevel = 5.93; - locations.ElementAt(14).DesignWaterLevel = 5.93; - locations.ElementAt(15).DesignWaterLevel = 5.54; - locations.ElementAt(16).DesignWaterLevel = 5.86; - locations.ElementAt(17).DesignWaterLevel = 6.0; + locations.ElementAt(0).DesignWaterLevel = (RoundedDouble) 5.78; + locations.ElementAt(1).DesignWaterLevel = (RoundedDouble) 5.77; + locations.ElementAt(2).DesignWaterLevel = (RoundedDouble) 5.77; + locations.ElementAt(3).DesignWaterLevel = (RoundedDouble) 5.77; + locations.ElementAt(4).DesignWaterLevel = (RoundedDouble) 5.77; + locations.ElementAt(5).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(6).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(7).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(8).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(9).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(10).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(11).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(12).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(13).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(14).DesignWaterLevel = (RoundedDouble) 5.93; + locations.ElementAt(15).DesignWaterLevel = (RoundedDouble) 5.54; + locations.ElementAt(16).DesignWaterLevel = (RoundedDouble) 5.86; + locations.ElementAt(17).DesignWaterLevel = (RoundedDouble) 6.0; } private void SetHydraulicBoundaryLocationDesignWaterLevelCalculationConvergence(ICollection locations) @@ -232,24 +232,24 @@ private void SetHydraulicBoundaryLocationWaveHeightValues(ICollection locations) { - locations.ElementAt(0).WaveHeight = 4.13374; - locations.ElementAt(1).WaveHeight = 4.19044; - locations.ElementAt(2).WaveHeight = 4.01717; - locations.ElementAt(3).WaveHeight = 3.87408; - locations.ElementAt(4).WaveHeight = 3.73281; - locations.ElementAt(5).WaveHeight = 2.65268; - locations.ElementAt(6).WaveHeight = 3.04333; - locations.ElementAt(7).WaveHeight = 3.19952; - locations.ElementAt(8).WaveHeight = 3.3554; - locations.ElementAt(9).WaveHeight = 3.52929; - locations.ElementAt(10).WaveHeight = 3.62194; - locations.ElementAt(11).WaveHeight = 3.6851; - locations.ElementAt(12).WaveHeight = 3.72909; - locations.ElementAt(13).WaveHeight = 3.74794; - locations.ElementAt(14).WaveHeight = 3.29686; - locations.ElementAt(15).WaveHeight = 9.57558; - locations.ElementAt(16).WaveHeight = 8.01959; - locations.ElementAt(17).WaveHeight = 4.11447; + locations.ElementAt(0).WaveHeight = (RoundedDouble) 4.13374; + locations.ElementAt(1).WaveHeight = (RoundedDouble) 4.19044; + locations.ElementAt(2).WaveHeight = (RoundedDouble) 4.01717; + locations.ElementAt(3).WaveHeight = (RoundedDouble) 3.87408; + locations.ElementAt(4).WaveHeight = (RoundedDouble) 3.73281; + locations.ElementAt(5).WaveHeight = (RoundedDouble) 2.65268; + locations.ElementAt(6).WaveHeight = (RoundedDouble) 3.04333; + locations.ElementAt(7).WaveHeight = (RoundedDouble) 3.19952; + locations.ElementAt(8).WaveHeight = (RoundedDouble) 3.3554; + locations.ElementAt(9).WaveHeight = (RoundedDouble) 3.52929; + locations.ElementAt(10).WaveHeight = (RoundedDouble) 3.62194; + locations.ElementAt(11).WaveHeight = (RoundedDouble) 3.6851; + locations.ElementAt(12).WaveHeight = (RoundedDouble) 3.72909; + locations.ElementAt(13).WaveHeight = (RoundedDouble) 3.74794; + locations.ElementAt(14).WaveHeight = (RoundedDouble) 3.29686; + locations.ElementAt(15).WaveHeight = (RoundedDouble) 9.57558; + locations.ElementAt(16).WaveHeight = (RoundedDouble) 8.01959; + locations.ElementAt(17).WaveHeight = (RoundedDouble) 4.11447; } private void SetHydraulicBoundaryLocationWaveHeightCalculationConvergence(ICollection locations) Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -24,6 +24,7 @@ using System.IO; using System.Linq; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Controls.Commands; using Core.Common.Gui; @@ -32,6 +33,7 @@ using Rhino.Mocks; using Ringtoets.Common.Data.Calculation; using Ringtoets.Common.Data.Probabilistics; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.HeightStructures.Data; using Ringtoets.HydraRing.Data; @@ -151,46 +153,46 @@ private void AssertDesignWaterLevelValuesOnHydraulicBoundaryLocations(HydraulicBoundaryLocation[] hydraulicBoundaryLocations) { - Assert.AreEqual(5.78, hydraulicBoundaryLocations[0].DesignWaterLevel); - Assert.AreEqual(5.77, hydraulicBoundaryLocations[1].DesignWaterLevel); - Assert.AreEqual(5.77, hydraulicBoundaryLocations[2].DesignWaterLevel); - Assert.AreEqual(5.77, hydraulicBoundaryLocations[3].DesignWaterLevel); - Assert.AreEqual(5.77, hydraulicBoundaryLocations[4].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[5].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[6].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[7].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[8].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[9].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[10].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[11].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[12].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[13].DesignWaterLevel); - Assert.AreEqual(5.93, hydraulicBoundaryLocations[14].DesignWaterLevel); - Assert.AreEqual(5.54, hydraulicBoundaryLocations[15].DesignWaterLevel); - Assert.AreEqual(5.86, hydraulicBoundaryLocations[16].DesignWaterLevel); - Assert.AreEqual(6.0, hydraulicBoundaryLocations[17].DesignWaterLevel); + Assert.AreEqual((RoundedDouble) 5.78, hydraulicBoundaryLocations[0].DesignWaterLevel, hydraulicBoundaryLocations[0].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.77, hydraulicBoundaryLocations[1].DesignWaterLevel, hydraulicBoundaryLocations[1].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.77, hydraulicBoundaryLocations[2].DesignWaterLevel, hydraulicBoundaryLocations[2].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.77, hydraulicBoundaryLocations[3].DesignWaterLevel, hydraulicBoundaryLocations[3].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.77, hydraulicBoundaryLocations[4].DesignWaterLevel, hydraulicBoundaryLocations[4].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[5].DesignWaterLevel, hydraulicBoundaryLocations[5].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[6].DesignWaterLevel, hydraulicBoundaryLocations[6].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[7].DesignWaterLevel, hydraulicBoundaryLocations[7].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[8].DesignWaterLevel, hydraulicBoundaryLocations[8].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[9].DesignWaterLevel, hydraulicBoundaryLocations[9].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[10].DesignWaterLevel, hydraulicBoundaryLocations[10].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[11].DesignWaterLevel, hydraulicBoundaryLocations[11].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[12].DesignWaterLevel, hydraulicBoundaryLocations[12].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[13].DesignWaterLevel, hydraulicBoundaryLocations[13].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.93, hydraulicBoundaryLocations[14].DesignWaterLevel, hydraulicBoundaryLocations[14].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.54, hydraulicBoundaryLocations[15].DesignWaterLevel, hydraulicBoundaryLocations[15].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 5.86, hydraulicBoundaryLocations[16].DesignWaterLevel, hydraulicBoundaryLocations[16].DesignWaterLevel.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 6.0, hydraulicBoundaryLocations[17].DesignWaterLevel, hydraulicBoundaryLocations[17].DesignWaterLevel.GetAccuracy()); } private void AssertWaveHeightValuesOnHydraulicBoundaryLocations(HydraulicBoundaryLocation[] hydraulicBoundaryLocations) { - Assert.AreEqual(4.13374, hydraulicBoundaryLocations[0].WaveHeight); - Assert.AreEqual(4.19044, hydraulicBoundaryLocations[1].WaveHeight); - Assert.AreEqual(4.01717, hydraulicBoundaryLocations[2].WaveHeight); - Assert.AreEqual(3.87408, hydraulicBoundaryLocations[3].WaveHeight); - Assert.AreEqual(3.73281, hydraulicBoundaryLocations[4].WaveHeight); - Assert.AreEqual(2.65268, hydraulicBoundaryLocations[5].WaveHeight); - Assert.AreEqual(3.04333, hydraulicBoundaryLocations[6].WaveHeight); - Assert.AreEqual(3.19952, hydraulicBoundaryLocations[7].WaveHeight); - Assert.AreEqual(3.3554, hydraulicBoundaryLocations[8].WaveHeight); - Assert.AreEqual(3.52929, hydraulicBoundaryLocations[9].WaveHeight); - Assert.AreEqual(3.62194, hydraulicBoundaryLocations[10].WaveHeight); - Assert.AreEqual(3.6851, hydraulicBoundaryLocations[11].WaveHeight); - Assert.AreEqual(3.72909, hydraulicBoundaryLocations[12].WaveHeight); - Assert.AreEqual(3.74794, hydraulicBoundaryLocations[13].WaveHeight); - Assert.AreEqual(3.29686, hydraulicBoundaryLocations[14].WaveHeight); - Assert.AreEqual(9.57558, hydraulicBoundaryLocations[15].WaveHeight); - Assert.AreEqual(8.01959, hydraulicBoundaryLocations[16].WaveHeight); - Assert.AreEqual(4.11447, hydraulicBoundaryLocations[17].WaveHeight); + Assert.AreEqual((RoundedDouble) 4.13374, hydraulicBoundaryLocations[0].WaveHeight, hydraulicBoundaryLocations[0].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 4.19044, hydraulicBoundaryLocations[1].WaveHeight, hydraulicBoundaryLocations[1].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 4.01717, hydraulicBoundaryLocations[2].WaveHeight, hydraulicBoundaryLocations[2].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.87408, hydraulicBoundaryLocations[3].WaveHeight, hydraulicBoundaryLocations[3].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.73281, hydraulicBoundaryLocations[4].WaveHeight, hydraulicBoundaryLocations[4].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 2.65268, hydraulicBoundaryLocations[5].WaveHeight, hydraulicBoundaryLocations[5].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.04333, hydraulicBoundaryLocations[6].WaveHeight, hydraulicBoundaryLocations[6].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.19952, hydraulicBoundaryLocations[7].WaveHeight, hydraulicBoundaryLocations[7].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.3554, hydraulicBoundaryLocations[8].WaveHeight, hydraulicBoundaryLocations[8].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.52929, hydraulicBoundaryLocations[9].WaveHeight, hydraulicBoundaryLocations[9].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.62194, hydraulicBoundaryLocations[10].WaveHeight, hydraulicBoundaryLocations[10].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.6851, hydraulicBoundaryLocations[11].WaveHeight, hydraulicBoundaryLocations[11].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.72909, hydraulicBoundaryLocations[12].WaveHeight, hydraulicBoundaryLocations[12].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.74794, hydraulicBoundaryLocations[13].WaveHeight, hydraulicBoundaryLocations[13].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 3.29686, hydraulicBoundaryLocations[14].WaveHeight, hydraulicBoundaryLocations[14].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 9.57558, hydraulicBoundaryLocations[15].WaveHeight, hydraulicBoundaryLocations[15].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 8.01959, hydraulicBoundaryLocations[16].WaveHeight, hydraulicBoundaryLocations[16].WaveHeight.GetAccuracy()); + Assert.AreEqual((RoundedDouble) 4.11447, hydraulicBoundaryLocations[17].WaveHeight, hydraulicBoundaryLocations[17].WaveHeight.GetAccuracy()); } private void AssertCharacteristicPointsOnSurfaceLines(RingtoetsPipingSurfaceLine[] surfaceLines) Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj =================================================================== diff -u -rfea3ed82dfb6dfcad535eef16efcbaa9c01564ed -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj (.../Demo.Ringtoets.Test.csproj) (revision fea3ed82dfb6dfcad535eef16efcbaa9c01564ed) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Demo.Ringtoets.Test.csproj (.../Demo.Ringtoets.Test.csproj) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -114,6 +114,10 @@ {d4200f43-3f72-4f42-af0a-8ced416a38ec} Ringtoets.Common.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {90de728e-48ef-4665-ab38-3d88e41d9f4d} Ringtoets.GrassCoverErosionInwards.Data Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs =================================================================== diff -u -r4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.Data/HydraulicBoundaryLocation.cs (.../HydraulicBoundaryLocation.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -21,6 +21,7 @@ using System; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Base.Storage; @@ -31,6 +32,9 @@ /// public class HydraulicBoundaryLocation : Observable, IStorable { + private RoundedDouble designWaterLevel; + private RoundedDouble waveHeight; + /// /// Creates a new instance of . /// @@ -48,8 +52,8 @@ Id = id; Name = name; Location = new Point2D(coordinateX, coordinateY); - DesignWaterLevel = double.NaN; - WaveHeight = double.NaN; + designWaterLevel = new RoundedDouble(2, double.NaN); + waveHeight = new RoundedDouble(2, double.NaN); } /// @@ -70,12 +74,32 @@ /// /// Gets the design water level of . /// - public double DesignWaterLevel { get; set; } + public RoundedDouble DesignWaterLevel + { + get + { + return designWaterLevel; + } + set + { + designWaterLevel = value.ToPrecision(designWaterLevel.NumberOfDecimalPlaces); + } + } /// /// Gets the wave height of . /// - public double WaveHeight { get; set; } + public RoundedDouble WaveHeight + { + get + { + return waveHeight; + } + set + { + waveHeight = value.ToPrecision(waveHeight.NumberOfDecimalPlaces); + } + } /// /// Gets or sets the convergence status of the design waterlevel calculation. Index: Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs =================================================================== diff -u -r4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision 4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866) +++ Ringtoets/HydraRing/src/Ringtoets.HydraRing.IO/HydraulicBoundaryLocationsWriter.cs (.../HydraulicBoundaryLocationsWriter.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -90,8 +90,8 @@ mapFeature.MetaData.Add("Naam", hydraulicBoundaryLocation.Name); mapFeature.MetaData.Add("Id", hydraulicBoundaryLocation.Id); - mapFeature.MetaData.Add("Toetspeil", hydraulicBoundaryLocation.DesignWaterLevel); - mapFeature.MetaData.Add("Hs", hydraulicBoundaryLocation.WaveHeight); + mapFeature.MetaData.Add("Toetspeil", hydraulicBoundaryLocation.DesignWaterLevel.Value); + mapFeature.MetaData.Add("Hs", hydraulicBoundaryLocation.WaveHeight.Value); return new MapPointData(hydraulicBoundaryLocation.Name) { Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs =================================================================== diff -u -r6f1e2e16c67292603f19489965183fa7176ff6af -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 6f1e2e16c67292603f19489965183fa7176ff6af) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.Data.Test/HydraulicBoundaryLocationTest.cs (.../HydraulicBoundaryLocationTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -61,7 +61,9 @@ Assert.AreEqual(x, location.X); Assert.AreEqual(y, location.Y); Assert.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(2, hydraulicBoundaryLocation.DesignWaterLevel.NumberOfDecimalPlaces); Assert.IsNaN(hydraulicBoundaryLocation.WaveHeight); + Assert.AreEqual(2, hydraulicBoundaryLocation.WaveHeight.NumberOfDecimalPlaces); Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence); Assert.AreEqual(CalculationConvergence.NotCalculated, hydraulicBoundaryLocation.WaveHeightCalculationConvergence); } Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs =================================================================== diff -u -r4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision 4ba68ad8c0ed15ce0449c39a5c6df1ef53daf866) +++ Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/HydraulicBoundaryLocationsWriterTest.cs (.../HydraulicBoundaryLocationsWriterTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,6 +22,7 @@ using System; using System.IO; using System.Linq; +using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Framework; using Ringtoets.HydraRing.Data; @@ -72,8 +73,8 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) { - DesignWaterLevel = 111.111, - WaveHeight = 222.222 + DesignWaterLevel = (RoundedDouble) 111.111, + WaveHeight = (RoundedDouble) 222.222 }; string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, Index: Ringtoets/HydraRing/test/Ringtoets.HydraRing.IO.Test/test-data/PointShapefileMd5.dbf =================================================================== diff -u -r718ec8557636bd25dc37b11a836af2e6b3829be6 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 Binary files differ Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs =================================================================== diff -u -rbba9524cfdab4e69348fddab60efe718e7c1865b -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision bba9524cfdab4e69348fddab60efe718e7c1865b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/DesignWaterLevelLocationContextProperties.cs (.../DesignWaterLevelLocationContextProperties.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -72,7 +72,7 @@ { get { - return new RoundedDouble(2, data.HydraulicBoundaryLocation.DesignWaterLevel); + return data.HydraulicBoundaryLocation.DesignWaterLevel; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs =================================================================== diff -u -rbba9524cfdab4e69348fddab60efe718e7c1865b -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision bba9524cfdab4e69348fddab60efe718e7c1865b) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/PropertyClasses/WaveHeightLocationContextProperties.cs (.../WaveHeightLocationContextProperties.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -72,7 +72,7 @@ { get { - return new RoundedDouble(2, data.HydraulicBoundaryLocation.WaveHeight); + return data.HydraulicBoundaryLocation.WaveHeight; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs =================================================================== diff -u -rb4828e713796dd5e285276417c59b695a3d9cc73 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision b4828e713796dd5e285276417c59b695a3d9cc73) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/DesignWaterLevelCalculationActivity.cs (.../DesignWaterLevelCalculationActivity.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Core.Common.Base.Service; using Core.Common.Utils; using log4net; @@ -74,7 +75,7 @@ } PerformRun(() => DesignWaterLevelCalculationService.Validate(assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation), - () => hydraulicBoundaryLocation.DesignWaterLevel = double.NaN, + () => hydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) double.NaN, () => DesignWaterLevelCalculationService.Calculate(assessmentSection, assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation, @@ -85,7 +86,7 @@ { PerformFinish(() => { - hydraulicBoundaryLocation.DesignWaterLevel = Output.Result; + hydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) Output.Result; bool designWaterLevelCalculationConvergence = Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5; if (!designWaterLevelCalculationConvergence) Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs =================================================================== diff -u -r6f1e2e16c67292603f19489965183fa7176ff6af -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 6f1e2e16c67292603f19489965183fa7176ff6af) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/RingtoetsDataSynchronizationService.cs (.../RingtoetsDataSynchronizationService.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,6 +22,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Core.Common.Base.Data; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Calculation; using Ringtoets.GrassCoverErosionInwards.Data; @@ -136,8 +137,8 @@ !double.IsNaN(hydraulicBoundaryLocation.DesignWaterLevel) || !double.IsNaN(hydraulicBoundaryLocation.WaveHeight))) { - hydraulicBoundaryLocation.DesignWaterLevel = double.NaN; - hydraulicBoundaryLocation.WaveHeight = double.NaN; + hydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) double.NaN; + hydraulicBoundaryLocation.WaveHeight = (RoundedDouble) double.NaN; hydraulicBoundaryLocation.DesignWaterLevelCalculationConvergence = CalculationConvergence.NotCalculated; hydraulicBoundaryLocation.WaveHeightCalculationConvergence = CalculationConvergence.NotCalculated; locationAffected = true; Index: Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs =================================================================== diff -u -rb4828e713796dd5e285276417c59b695a3d9cc73 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision b4828e713796dd5e285276417c59b695a3d9cc73) +++ Ringtoets/Integration/src/Ringtoets.Integration.Service/WaveHeightCalculationActivity.cs (.../WaveHeightCalculationActivity.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Core.Common.Base.Data; using Core.Common.Base.Service; using Core.Common.Utils; using log4net; @@ -74,7 +75,7 @@ } PerformRun(() => WaveHeightCalculationService.Validate(assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation), - () => hydraulicBoundaryLocation.WaveHeight = double.NaN, + () => hydraulicBoundaryLocation.WaveHeight = (RoundedDouble) double.NaN, () => WaveHeightCalculationService.Calculate(assessmentSection, assessmentSection.HydraulicBoundaryDatabase, hydraulicBoundaryLocation, @@ -85,7 +86,7 @@ { PerformFinish(() => { - hydraulicBoundaryLocation.WaveHeight = Output.Result; + hydraulicBoundaryLocation.WaveHeight = (RoundedDouble) Output.Result; bool waveHeightCalculationConvergence = Math.Abs(Output.ActualTargetProbability - StatisticsConverter.NormToBeta(assessmentSection.FailureMechanismContribution.Norm)) <= 10e-5; if (!waveHeightCalculationConvergence) Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs =================================================================== diff -u -rf1bf048f691ca575f22e8807911ace0338fa425d -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision f1bf048f691ca575f22e8807911ace0338fa425d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/FailureMechanismContributionViewIntegrationTest.cs (.../FailureMechanismContributionViewIntegrationTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -23,13 +23,15 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Extensions.Forms; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.Probability; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.GrassCoverErosionInwards.Data; using Ringtoets.HeightStructures.Data; using Ringtoets.HydraRing.Data; @@ -51,11 +53,14 @@ const int normValue = 200; const int numberOfCalculations = 3; + var waveHeight = (RoundedDouble) 3.0; + var designWaterLevel = (RoundedDouble) 4.2; + HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "test", 0.0, 0.0) { - WaveHeight = 3.0, - DesignWaterLevel = 4.2 + WaveHeight = waveHeight, + DesignWaterLevel = designWaterLevel }); AssessmentSection assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) @@ -124,8 +129,8 @@ // Precondition Assert.AreEqual(failureMechanismContribution.Norm.ToString(), normTester.Text); - Assert.AreEqual(3.0, hydraulicBoundaryLocation.WaveHeight); - Assert.AreEqual(4.2, hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(waveHeight, hydraulicBoundaryLocation.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); Assert.IsNotNull(pipingCalculation.Output); Assert.IsNotNull(grassCoverErosionInwardsCalculation.Output); Assert.IsNotNull(heightStructuresCalculation.Output); @@ -156,11 +161,13 @@ // Setup const int normValue = 200; + var waveHeight = (RoundedDouble) 3.0; + var designWaterLevel = (RoundedDouble) 4.2; HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(1, "test", 0.0, 0.0) { - WaveHeight = 3.0, - DesignWaterLevel = 4.2 + WaveHeight = waveHeight, + DesignWaterLevel = designWaterLevel }); AssessmentSection assessmentSection = new AssessmentSection(AssessmentSectionComposition.Dike) @@ -209,8 +216,8 @@ // Precondition Assert.AreEqual(failureMechanismContribution.Norm.ToString(), normTester.Text); - Assert.AreEqual(3.0, hydraulicBoundaryLocation.WaveHeight); - Assert.AreEqual(4.2, hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(waveHeight, hydraulicBoundaryLocation.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); // Call Action call = () => normTester.Properties.Text = normValue.ToString(); @@ -225,7 +232,7 @@ } [Test] - public void NormTextBox_HydraulicBoundaryLocationNoOutputAndCalcultionWithOutputAndValueChanged_CalculationObserverNotifiedAndMessageLogged() + public void NormTextBox_HydraulicBoundaryLocationNoOutputAndCalculationWithOutputAndValueChanged_CalculationObserverNotifiedAndMessageLogged() { // Setup const int normValue = 200; Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs =================================================================== diff -u -rb4828e713796dd5e285276417c59b695a3d9cc73 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs (.../DesignWaterLevelLocationContextPropertiesTest.cs) (revision b4828e713796dd5e285276417c59b695a3d9cc73) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationContextPropertiesTest.cs (.../DesignWaterLevelLocationContextPropertiesTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -26,6 +26,7 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; @@ -72,7 +73,7 @@ const double x = 567.0; const double y = 890.0; const string name = ""; - const double designWaterLevel = 5.123456; + RoundedDouble designWaterLevel = (RoundedDouble) 0.123456; HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y) { @@ -93,8 +94,7 @@ Assert.AreEqual(name, properties.Name); Point2D coordinates = new Point2D(x, y); Assert.AreEqual(coordinates, properties.Location); - var expectedDesignWaterLevel = new RoundedDouble(2, designWaterLevel); - Assert.AreEqual(expectedDesignWaterLevel, properties.DesignWaterLevel); + Assert.AreEqual(designWaterLevel, properties.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); Assert.AreEqual(RingtoetsHydraRingDataResources.CalculationConvergence_NotCalculated, properties.Convergence); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs =================================================================== diff -u -rbba9524cfdab4e69348fddab60efe718e7c1865b -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs (.../DesignWaterLevelLocationsContextPropertiesTest.cs) (revision bba9524cfdab4e69348fddab60efe718e7c1865b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/DesignWaterLevelLocationsContextPropertiesTest.cs (.../DesignWaterLevelLocationsContextPropertiesTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -25,6 +25,7 @@ using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PropertyClasses; @@ -50,7 +51,7 @@ // Setup HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - const double designWaterLevel = 12.34; + RoundedDouble designWaterLevel = (RoundedDouble) 12.34; HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0) { DesignWaterLevel = designWaterLevel @@ -71,8 +72,7 @@ Assert.AreEqual(hydraulicBoundaryLocation.Name, designWaterLevelLocationProperties.Name); Assert.AreEqual(hydraulicBoundaryLocation.Id, designWaterLevelLocationProperties.Id); Assert.AreEqual(hydraulicBoundaryLocation.Location, designWaterLevelLocationProperties.Location); - var expectedDesignWaterLevelValue = new RoundedDouble(2, designWaterLevel); - Assert.AreEqual(expectedDesignWaterLevelValue, designWaterLevelLocationProperties.DesignWaterLevel); + Assert.AreEqual(designWaterLevel, designWaterLevelLocationProperties.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); } [Test] Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs =================================================================== diff -u -rb4828e713796dd5e285276417c59b695a3d9cc73 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs (.../WaveHeightLocationContextPropertiesTest.cs) (revision b4828e713796dd5e285276417c59b695a3d9cc73) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationContextPropertiesTest.cs (.../WaveHeightLocationContextPropertiesTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -26,6 +26,7 @@ using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; @@ -72,7 +73,7 @@ const double x = 567.0; const double y = 890.0; const string name = ""; - const double waveHeight = 5.123456; + RoundedDouble waveHeight = (RoundedDouble) 0.123456; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, name, x, y) { @@ -93,8 +94,7 @@ Assert.AreEqual(name, properties.Name); Point2D coordinates = new Point2D(x, y); Assert.AreEqual(coordinates, properties.Location); - var expectedWaveHeight = new RoundedDouble(2, waveHeight); - Assert.AreEqual(expectedWaveHeight, properties.WaveHeight); + Assert.AreEqual(waveHeight, properties.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); Assert.AreEqual(RingtoetsHydraRingDataResources.CalculationConvergence_NotCalculated, properties.Convergence); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs =================================================================== diff -u -rbba9524cfdab4e69348fddab60efe718e7c1865b -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs (.../WaveHeightLocationsContextPropertiesTest.cs) (revision bba9524cfdab4e69348fddab60efe718e7c1865b) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs (.../WaveHeightLocationsContextPropertiesTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -27,6 +27,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; @@ -64,7 +65,7 @@ } }; - const double waveHeight = 12.34; + RoundedDouble waveHeight = (RoundedDouble) 12.34; HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0) { WaveHeight = waveHeight @@ -85,8 +86,7 @@ Assert.AreEqual(hydraulicBoundaryLocation.Name, waveHeightLocationProperties.Name); Assert.AreEqual(hydraulicBoundaryLocation.Id, waveHeightLocationProperties.Id); Assert.AreEqual(hydraulicBoundaryLocation.Location, waveHeightLocationProperties.Location); - var expectedWaveHeightValue = new RoundedDouble(2, waveHeight); - Assert.AreEqual(expectedWaveHeightValue, waveHeightLocationProperties.WaveHeight); + Assert.AreEqual(waveHeight, waveHeightLocationProperties.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r82c089ea04d564cd80d55a8e0f74a112efbe9c0f -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 82c089ea04d564cd80d55a8e0f74a112efbe9c0f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/DesignWaterLevelLocationsContextTreeNodeInfoTest.cs (.../DesignWaterLevelLocationsContextTreeNodeInfoTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -23,6 +23,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; +using Core.Common.Base.Data; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; @@ -33,6 +34,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Integration.Forms.PresentationObjects; @@ -228,11 +230,12 @@ // Given var guiMock = mockRepository.DynamicMock(); var contextMenuRunAssessmentLevelCalculationsIndex = 0; + RoundedDouble designWaterLevel = (RoundedDouble) 4.2; var hydraulicBoundaryLocation1 = new HydraulicBoundaryLocation(100001, "", 1.1, 2.2); var hydraulicBoundaryLocation2 = new HydraulicBoundaryLocation(100002, "", 3.3, 4.4) { - DesignWaterLevel = 4.2 + DesignWaterLevel = designWaterLevel }; var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase @@ -275,7 +278,9 @@ TestHelper.AssertLogMessageWithLevelIsGenerated(action, new Tuple(message, LogLevelConstant.Error)); Assert.IsNaN(hydraulicBoundaryLocation1.DesignWaterLevel); // No result set - Assert.AreEqual(4.2, hydraulicBoundaryLocation2.DesignWaterLevel); // Previous result not cleared + + // Previous result not cleared + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation2.DesignWaterLevel, hydraulicBoundaryLocation2.DesignWaterLevel.GetAccuracy()); } } mockRepository.VerifyAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs =================================================================== diff -u -r82c089ea04d564cd80d55a8e0f74a112efbe9c0f -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 82c089ea04d564cd80d55a8e0f74a112efbe9c0f) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/TreeNodeInfos/WaveHeightLocationsContextTreeNodeInfoTest.cs (.../WaveHeightLocationsContextTreeNodeInfoTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -23,6 +23,7 @@ using System.Drawing; using System.Linq; using System.Windows.Forms; +using Core.Common.Base.Data; using Core.Common.Controls.TreeView; using Core.Common.Gui; using Core.Common.Gui.ContextMenu; @@ -32,6 +33,7 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.Properties; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; @@ -277,10 +279,11 @@ var contextMenuRunWaveHeightCalculationsIndex = 0; + RoundedDouble designWaterLevel = (RoundedDouble) 4.2; var hydraulicBoundaryLocation1 = new HydraulicBoundaryLocation(100001, "", 1.1, 2.2); var hydraulicBoundaryLocation2 = new HydraulicBoundaryLocation(100002, "", 3.3, 4.4) { - WaveHeight = 4.2 + WaveHeight = designWaterLevel }; var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase @@ -322,7 +325,9 @@ TestHelper.AssertLogMessageWithLevelIsGenerated(action, new Tuple(message, LogLevelConstant.Error)); Assert.IsNaN(hydraulicBoundaryLocation1.WaveHeight); // No result set - Assert.AreEqual(4.2, hydraulicBoundaryLocation2.WaveHeight); // Previous result not cleared + + // Previous result not cleared + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation2.WaveHeight, hydraulicBoundaryLocation2.WaveHeight.GetAccuracy()); } } mockRepository.VerifyAll(); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationContextRowTest.cs =================================================================== diff -u -rf1bf048f691ca575f22e8807911ace0338fa425d -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationContextRowTest.cs (.../DesignWaterLevelLocationContextRowTest.cs) (revision f1bf048f691ca575f22e8807911ace0338fa425d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationContextRowTest.cs (.../DesignWaterLevelLocationContextRowTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -23,6 +23,7 @@ using Core.Common.Base.Data; using Core.Common.Base.Geometry; using NUnit.Framework; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.Views; @@ -51,7 +52,7 @@ const string locationname = "LocationName"; const double coordinateX = 1.0; const double coordinateY = 2.0; - const double designWaterLevel = 3.0; + RoundedDouble designWaterLevel = (RoundedDouble) 3.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(id, locationname, coordinateX, coordinateY) { DesignWaterLevel = designWaterLevel @@ -67,8 +68,7 @@ // Assert Assert.AreEqual(id, row.Id); Assert.AreEqual(locationname, row.Name); - var expectedDesignWaterLevel = new RoundedDouble(2, designWaterLevel); - Assert.AreEqual(expectedDesignWaterLevel, row.DesignWaterLevel); + Assert.AreEqual(designWaterLevel, row.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); var expectedPoint2D = new Point2D(coordinateX, coordinateY); Assert.AreEqual(expectedPoint2D, row.Location); Assert.AreSame(context, row.DesignWaterLevelLocationContext); Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs =================================================================== diff -u -red0ac171987ec828fb4aebf32493a41d43c7599c -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision ed0ac171987ec828fb4aebf32493a41d43c7599c) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/DesignWaterLevelLocationsViewTest.cs (.../DesignWaterLevelLocationsViewTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -25,6 +25,7 @@ using System.Linq; using System.Windows.Forms; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Controls.Views; using Core.Common.Gui.Selection; @@ -177,10 +178,11 @@ DesignWaterLevelLocationsView view = ShowFullyConfiguredDesignWaterLevelLocationsView(); IAssessmentSection assessmentSection = (IAssessmentSection) view.Data; HydraulicBoundaryDatabase newHydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - newHydraulicBoundaryDatabase.Locations.Add(new HydraulicBoundaryLocation(10, "10", 10.0, 10.0) + var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(10, "10", 10.0, 10.0) { - DesignWaterLevel = 10.23 - }); + DesignWaterLevel = (RoundedDouble) 10.23 + }; + newHydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); // Precondition var dataGridView = (DataGridView) new ControlTester("dataGridView").TheObject; @@ -199,7 +201,7 @@ Assert.AreEqual("10", cells[locationNameColumnIndex].FormattedValue); Assert.AreEqual("10", cells[locationIdColumnIndex].FormattedValue); Assert.AreEqual(new Point2D(10, 10).ToString(), cells[locationColumnIndex].FormattedValue); - Assert.AreEqual(10.23.ToString(CultureInfo.CurrentCulture), cells[locationDesignWaterlevelColumnIndex].FormattedValue); + Assert.AreEqual(hydraulicBoundaryLocation.DesignWaterLevel, cells[locationDesignWaterlevelColumnIndex].Value); } [Test] @@ -218,7 +220,7 @@ Assert.AreEqual("-", rows[2].Cells[locationDesignWaterlevelColumnIndex].FormattedValue); // Call - assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevel = double.NaN); + assessmentSection.HydraulicBoundaryDatabase.Locations.ForEach(loc => loc.DesignWaterLevel = (RoundedDouble) double.NaN); assessmentSection.NotifyObservers(); // Assert @@ -460,11 +462,11 @@ Locations.Add(new HydraulicBoundaryLocation(1, "1", 1.0, 1.0)); Locations.Add(new HydraulicBoundaryLocation(2, "2", 2.0, 2.0) { - DesignWaterLevel = 1.23 + DesignWaterLevel = (RoundedDouble) 1.23 }); Locations.Add(new HydraulicBoundaryLocation(3, "3", 3.0, 3.0) { - WaveHeight = 2.45 + WaveHeight = (RoundedDouble) 2.45 }); } } Index: Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileExporters/HydraulicBoundaryLocationsExporterTest.cs =================================================================== diff -u -rf1bf048f691ca575f22e8807911ace0338fa425d -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileExporters/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision f1bf048f691ca575f22e8807911ace0338fa425d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Plugin.Test/FileExporters/HydraulicBoundaryLocationsExporterTest.cs (.../HydraulicBoundaryLocationsExporterTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,6 +22,7 @@ using System; using System.IO; using System.Security.AccessControl; +using Core.Common.Base.Data; using Core.Common.Base.IO; using Core.Common.TestUtil; using NUnit.Framework; @@ -38,8 +39,8 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) { - DesignWaterLevel = 111.111, - WaveHeight = 222.222 + DesignWaterLevel = (RoundedDouble) 111.111, + WaveHeight = (RoundedDouble) 222.222 }; string filePath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, "test.shp"); @@ -74,8 +75,8 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) { - DesignWaterLevel = 111.111, - WaveHeight = 222.222 + DesignWaterLevel = (RoundedDouble) 111.111, + WaveHeight = (RoundedDouble) 222.222 }; // Call @@ -94,8 +95,8 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) { - DesignWaterLevel = 111.111, - WaveHeight = 222.222 + DesignWaterLevel = (RoundedDouble) 111.111, + WaveHeight = (RoundedDouble) 222.222 }; string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, @@ -129,8 +130,8 @@ // Setup var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(123, "aName", 1.1, 2.2) { - DesignWaterLevel = 111.111, - WaveHeight = 222.222 + DesignWaterLevel = (RoundedDouble) 111.111, + WaveHeight = (RoundedDouble) 222.222 }; string directoryPath = TestHelper.GetTestDataPath(TestDataPath.Ringtoets.HydraRing.IO, Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs =================================================================== diff -u -r35baeb163866f62a72bccf6438ddc08b41407ecf -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 35baeb163866f62a72bccf6438ddc08b41407ecf) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/DesignWaterLevelCalculationActivityTest.cs (.../DesignWaterLevelCalculationActivityTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -22,13 +22,15 @@ using System; using System.IO; using System.Linq; +using Core.Common.Base.Data; using Core.Common.Base.Service; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Integration.Plugin.FileImporters; @@ -208,10 +210,9 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); - var designWaterLevel = 3.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) { - DesignWaterLevel = designWaterLevel + DesignWaterLevel = (RoundedDouble) 3.0 }; var activity = new DesignWaterLevelCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); @@ -350,7 +351,7 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); - const double designWaterLevel = 3.0; + RoundedDouble designWaterLevel = (RoundedDouble) 3.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) { DesignWaterLevel = designWaterLevel @@ -364,7 +365,7 @@ activity.Finish(); // Assert - Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel); + Assert.AreEqual(designWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel, hydraulicBoundaryLocation.DesignWaterLevel.GetAccuracy()); mockRepository.VerifyAll(); } Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Ringtoets.Integration.Service.Test.csproj =================================================================== diff -u -r3d84064b23186da3fb11f19ff0d07f41e1209bbb -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Ringtoets.Integration.Service.Test.csproj (.../Ringtoets.Integration.Service.Test.csproj) (revision 3d84064b23186da3fb11f19ff0d07f41e1209bbb) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/Ringtoets.Integration.Service.Test.csproj (.../Ringtoets.Integration.Service.Test.csproj) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -85,6 +85,10 @@ {D4200F43-3F72-4F42-AF0A-8CED416A38EC} Ringtoets.Common.Data + + {4843D6E5-066F-4795-94F5-1D53932DD03C} + Ringtoets.Common.Data.TestUtil + {90DE728E-48EF-4665-AB38-3D88E41D9F4D} Ringtoets.GrassCoverErosionInwards.Data Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs =================================================================== diff -u -r7be0d1a56ae574fda540c06b808e017ad7695e90 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 7be0d1a56ae574fda540c06b808e017ad7695e90) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/RingtoetsDataSynchronizationServiceTest.cs (.../RingtoetsDataSynchronizationServiceTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using Core.Common.Base.Data; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; @@ -407,8 +408,8 @@ // Setup HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 0, 0) { - WaveHeight = 1.0, - DesignWaterLevel = 3.0 + WaveHeight = (RoundedDouble) 1.0, + DesignWaterLevel = (RoundedDouble) 3.0 }; HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); @@ -428,7 +429,7 @@ // Setup HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 0, 0) { - DesignWaterLevel = 3.0 + DesignWaterLevel = (RoundedDouble) 3.0 }; HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); @@ -447,7 +448,7 @@ // Setup HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 0, 0) { - WaveHeight = 1.0, + WaveHeight = (RoundedDouble) 1.0, }; HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); hydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); Index: Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs =================================================================== diff -u -rf1bf048f691ca575f22e8807911ace0338fa425d -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision f1bf048f691ca575f22e8807911ace0338fa425d) +++ Ringtoets/Integration/test/Ringtoets.Integration.Service.Test/WaveHeightCalculationActivityTest.cs (.../WaveHeightCalculationActivityTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -23,13 +23,15 @@ using System.IO; using System.Linq; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.Base.Service; using Core.Common.TestUtil; using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Data.TestUtil; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Plugin.FileImporters; @@ -214,10 +216,9 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); - const double waveHeight = 3.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) { - WaveHeight = waveHeight + WaveHeight = (RoundedDouble) 3.0 }; var activity = new WaveHeightCalculationActivity(assessmentSectionStub, hydraulicBoundaryLocation); @@ -368,7 +369,7 @@ ImportHydraulicBoundaryDatabase(assessmentSectionStub); - const double waveHeight = 3.0; + RoundedDouble waveHeight = (RoundedDouble) 3.0; var hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "test", 1, 1) { WaveHeight = waveHeight @@ -382,7 +383,7 @@ activity.Finish(); // Assert - Assert.AreEqual(waveHeight, hydraulicBoundaryLocation.WaveHeight); + Assert.AreEqual(waveHeight, hydraulicBoundaryLocation.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); mockRepository.VerifyAll(); } Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs =================================================================== diff -u -ra7ba75d934df79407c6fa412f904289034bc0262 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision a7ba75d934df79407c6fa412f904289034bc0262) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -67,18 +67,18 @@ var input = new PipingInput(new GeneralPipingInput()); var derivedInput = new DerivedPipingInput(input); - double testLevel = new Random(21).NextDouble(); + RoundedDouble testLevel = (RoundedDouble) new Random(21).NextDouble(); input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0) { DesignWaterLevel = testLevel }; // Call - var calculatedAssesmentLevel = derivedInput.AssessmentLevel; + var calculatedAssessmentLevel = derivedInput.AssessmentLevel; // Assert - Assert.AreEqual(new RoundedDouble(2, testLevel), calculatedAssesmentLevel); + Assert.AreEqual(testLevel, calculatedAssessmentLevel, derivedInput.AssessmentLevel.GetAccuracy()); } [Test] @@ -91,10 +91,10 @@ input.HydraulicBoundaryLocation = null; // Call - var calculatedAssesmentLevel = derivedInput.AssessmentLevel; + var calculatedAssessmentLevel = derivedInput.AssessmentLevel; // Assert - Assert.IsNaN(calculatedAssesmentLevel); + Assert.IsNaN(calculatedAssessmentLevel); } [Test] @@ -107,10 +107,10 @@ input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0); // Call - var calculatedAssesmentLevel = derivedInput.AssessmentLevel; + var calculatedAssessmentLevel = derivedInput.AssessmentLevel; // Assert - Assert.IsNaN(calculatedAssesmentLevel); + Assert.IsNaN(calculatedAssessmentLevel); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs =================================================================== diff -u -ra7ba75d934df79407c6fa412f904289034bc0262 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision a7ba75d934df79407c6fa412f904289034bc0262) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -371,18 +371,18 @@ // Setup PipingInput input = new PipingInput(new GeneralPipingInput()); - double testLevel = new Random(21).NextDouble(); + RoundedDouble testLevel = (RoundedDouble)new Random(21).NextDouble(); input.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0.0, 0.0) { DesignWaterLevel = testLevel }; // Call - RoundedDouble calculatedAssesmentLevel = input.AssessmentLevel; + RoundedDouble calculatedAssessmentLevel = input.AssessmentLevel; // Assert - Assert.AreEqual(new RoundedDouble(2, testLevel), calculatedAssesmentLevel); + Assert.AreEqual(testLevel, calculatedAssessmentLevel, input.AssessmentLevel.GetAccuracy()); } [Test] Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -rac2a8327f9ce8b42d2e2740a0cda030385c5c63c -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision ac2a8327f9ce8b42d2e2740a0cda030385c5c63c) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -236,7 +236,7 @@ StochasticSoilModel stochasticSoilModel = new StochasticSoilModel(0, "StochasticSoilModelName", "StochasticSoilModelSegmentName"); stochasticSoilModel.StochasticSoilProfiles.Add(stochasticSoilProfile); - HydraulicBoundaryLocation testHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation(0.0); + HydraulicBoundaryLocation testHydraulicBoundaryLocation = new TestHydraulicBoundaryLocation((RoundedDouble) 0.0); PipingInput inputParameters = new PipingInput(new GeneralPipingInput()) { @@ -357,7 +357,7 @@ Random random = new Random(22); - double assessmentLevel = random.NextDouble(); + RoundedDouble assessmentLevel = (RoundedDouble) random.NextDouble(); LogNormalDistribution dampingFactorExit = new LogNormalDistribution(3); NormalDistribution phreaticLevelExit = new NormalDistribution(2); @@ -671,7 +671,7 @@ projectObserver.Expect(o => o.UpdateObserver()); mocks.ReplayAll(); - double assessmentLevel = new Random(21).NextDouble(); + RoundedDouble assessmentLevel = (RoundedDouble) new Random(21).NextDouble(); PipingCalculationScenario calculationItem = new PipingCalculationScenario(new GeneralPipingInput()); PipingFailureMechanism failureMechanism = new PipingFailureMechanism(); @@ -697,7 +697,7 @@ string testName = "TestName"; HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, testName, 0, 0) { - DesignWaterLevel = double.NaN + DesignWaterLevel = (RoundedDouble) double.NaN }; // Call @@ -735,7 +735,7 @@ assessmentSectionMock) }; - double testLevel = new Random(21).NextDouble(); + RoundedDouble testLevel = (RoundedDouble) new Random(21).NextDouble(); HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0) { DesignWaterLevel = testLevel @@ -745,7 +745,7 @@ properties.HydraulicBoundaryLocation = hydraulicBoundaryLocation; // Assert - Assert.AreEqual(testLevel, properties.AssessmentLevel, 1e-2); + Assert.AreEqual(testLevel, properties.AssessmentLevel, properties.AssessmentLevel.GetAccuracy()); mocks.VerifyAll(); } @@ -958,7 +958,7 @@ }; inputParameters.HydraulicBoundaryLocation = new HydraulicBoundaryLocation(0, string.Empty, 0, 0) { - DesignWaterLevel = 1.0 + DesignWaterLevel = (RoundedDouble) 1.0 }; DesignVariable phreaticLevelExitProperty = contextProperties.PhreaticLevelExit; @@ -1003,7 +1003,7 @@ private class TestHydraulicBoundaryLocation : HydraulicBoundaryLocation { - public TestHydraulicBoundaryLocation(double designWaterLevel) : base(0, string.Empty, 0, 0) + public TestHydraulicBoundaryLocation(RoundedDouble designWaterLevel) : base(0, string.Empty, 0, 0) { DesignWaterLevel = designWaterLevel; } Index: Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs =================================================================== diff -u -r8650820cbc2da7dcd34964bc92046fe66d14ec23 -r3d995a76fbe93cf9801596e6b959e7f5bcde5805 --- Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 8650820cbc2da7dcd34964bc92046fe66d14ec23) +++ Ringtoets/Piping/test/Ringtoets.Piping.Service.Test/PipingCalculationServiceTest.cs (.../PipingCalculationServiceTest.cs) (revision 3d995a76fbe93cf9801596e6b959e7f5bcde5805) @@ -138,7 +138,7 @@ const string name = ""; PipingCalculation calculation = PipingCalculationFactory.CreateCalculationWithValidInput(); - calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = double.NaN; + calculation.InputParameters.HydraulicBoundaryLocation.DesignWaterLevel = (RoundedDouble) double.NaN; calculation.Name = name; // Call