public void Data_SetNewForeshoreProfileInstance_ReturnCorrectPropertyValues() { // Setup const string id = "VP"; const string name = "Voorlandprofiel"; var foreshoreProfile = new ForeshoreProfile(new Point2D(12.34, 56.78), new Point2D[0], null, new ForeshoreProfile.ConstructionProperties { Id = id, Name = name }); // Call var properties = new ForeshoreProfileProperties { Data = foreshoreProfile }; // Assert Assert.AreEqual(new Point2D(12, 57), properties.WorldReferencePoint); Assert.AreEqual(id, properties.Id); Assert.AreEqual(name, properties.Name); Assert.AreEqual(2, properties.Orientation.NumberOfDecimalPlaces); Assert.AreEqual(0.0, properties.Orientation.Value); Assert.AreSame(foreshoreProfile, properties.BreakWater.Data); Assert.AreEqual(foreshoreProfile, properties.Foreshore.Data); }
public void Constructor_ExpectedValues() { // Call var properties = new ForeshoreProfileProperties(); // Assert Assert.IsInstanceOf <ObjectProperties <ForeshoreProfile> >(properties); Assert.IsNull(properties.Data); }
public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup var foreshoreProfile = new TestForeshoreProfile(); // Call var properties = new ForeshoreProfileProperties { Data = foreshoreProfile }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(6, dynamicProperties.Count); PropertyDescriptor idProperty = dynamicProperties[idPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(idProperty, "Algemeen", "ID", "ID van het voorlandprofiel.", true); PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, "Algemeen", "Naam", "Naam van het voorlandprofiel.", true); PropertyDescriptor worldReferencePointProperty = dynamicProperties[worldReferencePointPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(worldReferencePointProperty, "Schematisatie", "Locatie (RD) [m]", "De coördinaten van de locatie van het voorlandprofiel in het Rijksdriehoeksstelsel.", true); PropertyDescriptor orientationProperty = dynamicProperties[orientationPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(orientationProperty, "Schematisatie", "Oriëntatie [°]", "Oriëntatie van de dijknormaal ten opzichte van het noorden.", true); PropertyDescriptor breakWaterProperty = dynamicProperties[breakWaterPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(breakWaterProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(breakWaterProperty, "Schematisatie", "Dam", "Eigenschappen van de dam.", true); PropertyDescriptor foreshoreProperty = dynamicProperties[foreshoreGeometryPropertyIndex]; Assert.IsInstanceOf <ExpandableObjectConverter>(foreshoreProperty.Converter); PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(foreshoreProperty, "Schematisatie", "Voorlandgeometrie", "Eigenschappen van de voorlandgeometrie.", true); }