Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs =================================================================== diff -u -re182f6f394aa75e739467a77e7bcacd9a8b25429 -re1d4d3fe987bfa6504703952ea0dbd8a18f5a698 --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs (.../WaveHeightLocationsContextPropertiesTest.cs) (revision e182f6f394aa75e739467a77e7bcacd9a8b25429) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/WaveHeightLocationsContextPropertiesTest.cs (.../WaveHeightLocationsContextPropertiesTest.cs) (revision e1d4d3fe987bfa6504703952ea0dbd8a18f5a698) @@ -21,15 +21,12 @@ using System.ComponentModel; using System.Linq; -using Core.Common.Base.Data; using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; +using Core.Common.Utils.Reflection; using NUnit.Framework; -using Rhino.Mocks; -using Ringtoets.Common.Data.AssessmentSection; using Ringtoets.Common.Data.Hydraulics; using Ringtoets.Common.Data.TestUtil; -using Ringtoets.Integration.Forms.PresentationObjects; using Ringtoets.Integration.Forms.PropertyClasses; namespace Ringtoets.Integration.Forms.Test.PropertyClasses @@ -52,42 +49,32 @@ public void GetProperties_WithData_ReturnExpectedValues() { // Setup - var mockRepository = new MockRepository(); - var assessmentSectionMock = mockRepository.Stub(); - mockRepository.ReplayAll(); - - HydraulicBoundaryDatabase hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - WaveHeightLocationsContext context = new WaveHeightLocationsContext(assessmentSectionMock) + HydraulicBoundaryLocation location = TestHydraulicBoundaryLocation.CreateWaveHeightCalculated(1.5); + var hydraulicBoundaryDatabase = new HydraulicBoundaryDatabase { - WrappedData = + Locations = { - HydraulicBoundaryDatabase = hydraulicBoundaryDatabase + location } }; - RoundedDouble waveHeight = (RoundedDouble) 12.34; - HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0) - { - WaveHeight = waveHeight - }; - context.WrappedData.HydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - // Call - WaveHeightLocationsContextProperties properties = new WaveHeightLocationsContextProperties + var properties = new WaveHeightLocationsContextProperties { Data = hydraulicBoundaryDatabase }; // Assert CollectionAssert.AllItemsAreInstancesOfType(properties.Locations, typeof(WaveHeightLocationContextProperties)); Assert.AreEqual(1, properties.Locations.Length); + Assert.IsTrue(TypeUtils.HasTypeConverter(p => p.Locations)); WaveHeightLocationContextProperties waveHeightLocationProperties = properties.Locations.First(); - Assert.AreEqual(hydraulicBoundaryLocation.Name, waveHeightLocationProperties.Name); - Assert.AreEqual(hydraulicBoundaryLocation.Id, waveHeightLocationProperties.Id); - Assert.AreEqual(hydraulicBoundaryLocation.Location, waveHeightLocationProperties.Location); - Assert.AreEqual(waveHeight, waveHeightLocationProperties.WaveHeight, hydraulicBoundaryLocation.WaveHeight.GetAccuracy()); - mockRepository.VerifyAll(); + Assert.AreEqual(location.Name, waveHeightLocationProperties.Name); + Assert.AreEqual(location.Id, waveHeightLocationProperties.Id); + Assert.AreEqual(location.Location, waveHeightLocationProperties.Location); + Assert.AreEqual(location.WaveHeight, waveHeightLocationProperties.WaveHeight, location.WaveHeight.GetAccuracy()); } [Test]