public void Constructor_ValidData_PropertiesHaveExpectedAttributeValues() { // Setup MacroStabilityInwardsPhreaticLine phreaticLine = MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine(); // Call var properties = new MacroStabilityInwardsPhreaticLineProperties(phreaticLine); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(2, dynamicProperties.Count); const string waterStressesCategoryName = "Waterspanningen"; PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, waterStressesCategoryName, "Naam", "De naam van de lijn.", true); PropertyDescriptor geometryProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(geometryProperty, waterStressesCategoryName, "Geometrie", "De geometrie van de lijn.", true); }
public void ToString_Always_ReturnsName() { // Setup const string expectedName = "PL2"; var phreaticLine = new MacroStabilityInwardsPhreaticLine(expectedName, Enumerable.Empty <Point2D>()); var properties = new MacroStabilityInwardsPhreaticLineProperties(phreaticLine); // Call var name = properties.ToString(); // Assert Assert.AreEqual(name, expectedName); }
public void Constructor_ValidPhreaticLine_ExpectedValues() { // Setup MacroStabilityInwardsPhreaticLine phreaticLine = MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine(); // Call var properties = new MacroStabilityInwardsPhreaticLineProperties(phreaticLine); // Assert Assert.IsInstanceOf <ObjectProperties <MacroStabilityInwardsPhreaticLine> >(properties); TestHelper.AssertTypeConverter <MacroStabilityInwardsPhreaticLineProperties, ExpandableReadOnlyArrayConverter>( nameof(MacroStabilityInwardsPhreaticLineProperties.Geometry)); Assert.AreSame(phreaticLine, properties.Data); }
public void GetProperties_WithData_ReturnExpectedValues() { // Setup var random = new Random(21); var phreaticLine = new MacroStabilityInwardsPhreaticLine("PL1", new[] { new Point2D(random.NextDouble(), random.NextDouble()), new Point2D(random.NextDouble(), random.NextDouble()) }); // Call var properties = new MacroStabilityInwardsPhreaticLineProperties(phreaticLine); // Assert Assert.AreEqual(phreaticLine.Name, properties.Name); CollectionAssert.AreEqual(phreaticLine.Geometry, properties.Geometry); }