public void Constructor_ReferenceLineWithGeometry_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ReferenceLineProperties(ReferenceLineTestFactory.CreateReferenceLineWithGeometry()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); const string generalCategoryName = "Algemeen"; PropertyDescriptor lengthProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(lengthProperty, generalCategoryName, "Lengte* [m]", "Totale lengte van het traject in meters (afgerond).", true); PropertyDescriptor geometryProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(geometryProperty, generalCategoryName, "Coördinaten", "Lijst van alle coördinaten (X-coördinaat, Y-coördinaat) " + "die samen de referentielijn vormen.", true); }
public void Constructor_ReferenceLineWithoutGeometry_PropertiesHaveExpectedAttributeValues() { // Call var properties = new ReferenceLineProperties(new ReferenceLine()); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(0, dynamicProperties.Count); }
public void Constructor_WithReferenceLine_ExpectedValues() { // Setup var referenceLine = new ReferenceLine(); // Call var properties = new ReferenceLineProperties(referenceLine); // Assert Assert.IsInstanceOf <ObjectProperties <ReferenceLine> >(properties); TestHelper.AssertTypeConverter <ReferenceLineProperties, ExpandableArrayConverter>( nameof(ReferenceLineProperties.Geometry)); Assert.AreSame(referenceLine, properties.Data); }
public void GetProperties_ReferenceLineWithGeometry_ReturnExpectedValues() { // Setup var random = new Random(39); var referenceLine = new ReferenceLine(); referenceLine.SetGeometry(new[] { new Point2D(random.NextDouble(), random.NextDouble()), new Point2D(random.NextDouble(), random.NextDouble()) }); // Call var properties = new ReferenceLineProperties(referenceLine); // Assert Assert.AreEqual(2, properties.Length.NumberOfDecimalPlaces); Assert.AreEqual(referenceLine.Length, properties.Length, properties.Length.GetAccuracy()); CollectionAssert.AreEqual(referenceLine.Points, properties.Geometry); }