public void Constructor_Always_PropertiesHaveExpectedAttributesValues() { // Setup DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); // Call var properties = new DikeProfileDikeGeometryProperties { Data = dikeProfile }; // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); PropertyDescriptor coordinatesProperty = dynamicProperties[coordinatesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(coordinatesProperty, "Misc", "Coördinaten [m]", "Lijst met punten in lokale coördinaten.", true); PropertyDescriptor roughnessesProperty = dynamicProperties[roughnessesPropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(roughnessesProperty, "Misc", "Ruwheid invloedsfactoren [-]", "Lijst met invloedsfactoren voor ruwheid op het talud van elk onderdeel.", true); }
public void Data_SetDikeProfileInstanceWithData_ReturnCorrectPropertyValues() { // Setup DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(new[] { new RoughnessPoint(new Point2D(0, 0), 0.6), new RoughnessPoint(new Point2D(1, 1), 0.7) }); var properties = new DikeProfileDikeGeometryProperties(); // Call properties.Data = dikeProfile; // Assert var expectedCoordinates = new[] { new Point2D(0, 0), new Point2D(1, 1) }; CollectionAssert.AreEqual(expectedCoordinates, properties.Coordinates); var expectedRoughness = new[] { new RoundedDouble(2, 0.6) }; CollectionAssert.AreEqual(expectedRoughness, properties.Roughnesses); }
public void Constructor_ExpectedValues() { // Call var properties = new DikeProfileDikeGeometryProperties(); // Assert Assert.IsInstanceOf <ObjectProperties <DikeProfile> >(properties); Assert.IsNull(properties.Data); Assert.IsEmpty(properties.ToString()); }
public void Data_SetNewDikeProfileInstance_ReturnCorrectPropertyValues() { // Setup DikeProfile dikeProfile = DikeProfileTestFactory.CreateDikeProfile(); var properties = new DikeProfileDikeGeometryProperties(); // Call properties.Data = dikeProfile; // Assert CollectionAssert.IsEmpty(properties.Coordinates); CollectionAssert.IsEmpty(properties.Roughnesses); }