Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs =================================================================== diff -u -r0f7eb2998561112d0013b667ee39c2316341d2fe -rc703acd9b4aa18825e6938815ba975c34949cc6f --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision 0f7eb2998561112d0013b667ee39c2316341d2fe) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/PropertyClasses/HydraulicBoundaryDatabasePropertiesTest.cs (.../HydraulicBoundaryDatabasePropertiesTest.cs) (revision c703acd9b4aa18825e6938815ba975c34949cc6f) @@ -20,8 +20,6 @@ // 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; @@ -54,30 +52,26 @@ var assessmentSectionMock = mocks.Stub(); mocks.ReplayAll(); - HydraulicBoundaryLocation hydraulicBoundaryLocation = new HydraulicBoundaryLocation(1, "name", 1.0, 2.0); - HydraulicBoundaryLocationProperties expectedLocationProperties = new HydraulicBoundaryLocationProperties(hydraulicBoundaryLocation); + const string filePath = @"C:\file.sqlite"; + HydraulicBoundaryDatabaseContext hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSectionMock) + { + WrappedData = + { + HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase + { + FilePath = filePath + } + } + }; - HydraulicBoundaryDatabaseContext hydraulicBoundaryDatabaseContext = new HydraulicBoundaryDatabaseContext(assessmentSectionMock); - hydraulicBoundaryDatabaseContext.WrappedData.HydraulicBoundaryDatabase = new HydraulicBoundaryDatabase(); - hydraulicBoundaryDatabaseContext.WrappedData.HydraulicBoundaryDatabase.FilePath = "Test"; - hydraulicBoundaryDatabaseContext.WrappedData.HydraulicBoundaryDatabase.Locations.Add(hydraulicBoundaryLocation); - // Call HydraulicBoundaryDatabaseProperties properties = new HydraulicBoundaryDatabaseProperties { Data = hydraulicBoundaryDatabaseContext }; // Assert - Assert.AreEqual(hydraulicBoundaryDatabaseContext.WrappedData.HydraulicBoundaryDatabase.FilePath, properties.FilePath); - CollectionAssert.AllItemsAreInstancesOfType(properties.Locations, typeof(HydraulicBoundaryLocationProperties)); - Assert.AreEqual(1, hydraulicBoundaryDatabaseContext.WrappedData.HydraulicBoundaryDatabase.Locations.Count); - - HydraulicBoundaryLocationProperties hydraulicBoundaryLocationProperties = properties.Locations.FirstOrDefault(); - Assert.AreEqual(expectedLocationProperties.Name, hydraulicBoundaryLocationProperties.Name); - Assert.AreEqual(expectedLocationProperties.Id, hydraulicBoundaryLocationProperties.Id); - Assert.AreEqual(expectedLocationProperties.Location, hydraulicBoundaryLocationProperties.Location); - Assert.AreEqual(expectedLocationProperties.DesignWaterLevel, hydraulicBoundaryLocationProperties.DesignWaterLevel); + Assert.AreEqual(filePath, properties.FilePath); } [Test] @@ -91,17 +85,13 @@ const string expectedFilePathDescription = "Locatie van het hydraulische randvoorwaardendatabase bestand."; const string expectedFilePathCategory = "Algemeen"; - const string expectedLocationsDisplayName = "Locaties"; - const string expectedLocationsDescription = "Locaties uit de hydraulische randvoorwaardendatabase."; - const string expectedLocationsCategory = "Algemeen"; - // Call TypeConverter classTypeConverter = TypeDescriptor.GetConverter(hydraulicBoundaryLocationProperties, true); + + // Assert PropertyDescriptorCollection dynamicProperties = dynamicPropertyBag.GetProperties(); PropertyDescriptor filePathProperty = dynamicProperties.Find("FilePath", false); - PropertyDescriptor locationsProperty = dynamicProperties.Find("Locations", false); - // Assert Assert.IsInstanceOf(classTypeConverter); Assert.IsNotNull(filePathProperty); @@ -110,14 +100,6 @@ 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