private static MacroStabilityInwardsWaternet CreateWaternet() { return(new MacroStabilityInwardsWaternet( new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() })); }
public void Constructor_ValidWaternetLine_ExpectedValues() { // Setup MacroStabilityInwardsWaternetLine waternetLine = MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine(); // Call var properties = new MacroStabilityInwardsWaternetLineProperties(waternetLine); // Assert Assert.IsInstanceOf <ObjectProperties <MacroStabilityInwardsWaternetLine> >(properties); TestHelper.AssertTypeConverter <MacroStabilityInwardsWaternetLineProperties, ExpandableReadOnlyArrayConverter>( nameof(MacroStabilityInwardsWaternetLineProperties.Geometry)); Assert.AreSame(waternetLine, properties.Data); }
private static IEnumerable <TestCaseData> GetUnequalTestCases() { yield return(new TestCaseData(new MacroStabilityInwardsWaternet( new[] { new MacroStabilityInwardsPhreaticLine("Test", new Point2D[0]) }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() })) .SetName("Other phreatic line")); yield return(new TestCaseData(new MacroStabilityInwardsWaternet( new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine(), MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() })) .SetName("Other phreatic line count")); yield return(new TestCaseData(new MacroStabilityInwardsWaternet( new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { new MacroStabilityInwardsWaternetLine("Test", new Point2D[0], MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine()) })) .SetName("Other Waternet line")); yield return(new TestCaseData(new MacroStabilityInwardsWaternet( new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine(), MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() })) .SetName("Other Waternet line count")); }
public void GetProperties_WithData_ReturnExpectedValues() { // Setup var waternet = new MacroStabilityInwardsWaternet(new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() }); // Call var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Assert Assert.AreSame(waternet.PhreaticLines.Single(), properties.PhreaticLines.Single().Data); Assert.AreSame(waternet.WaternetLines.Single(), properties.WaternetLines.Single().Data); }
public void Constructor_ValidWaternet_ExpectedValues() { // Setup var waternet = new MacroStabilityInwardsWaternet(new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsPhreaticLine() }, new[] { MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine() }); // Call var properties = new MacroStabilityInwardsWaternetProperties(waternet); // Assert Assert.IsInstanceOf <ObjectProperties <MacroStabilityInwardsWaternet> >(properties); TestHelper.AssertTypeConverter <MacroStabilityInwardsWaternetProperties, ExpandableReadOnlyArrayConverter>( nameof(MacroStabilityInwardsWaternetProperties.PhreaticLines)); Assert.AreSame(waternet, properties.Data); }
public void Constructor_ValidData_PropertiesHaveExpectedAttributeValues() { // Setup MacroStabilityInwardsWaternetLine waternetLine = MacroStabilityInwardsTestDataFactory.CreateMacroStabilityInwardsWaternetLine(); // Call var properties = new MacroStabilityInwardsWaternetLineProperties(waternetLine); // Assert PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties); Assert.AreEqual(3, dynamicProperties.Count); const string waterStressesCategoryName = "Waterspanningen"; PropertyDescriptor nameProperty = dynamicProperties[0]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty, waterStressesCategoryName, "Naam", "De naam van de zone.", true); PropertyDescriptor geometryProperty = dynamicProperties[1]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(geometryProperty, waterStressesCategoryName, "Geometrie", "De geometrie van de zone.", true); PropertyDescriptor phreaticLineNameProperty = dynamicProperties[2]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(phreaticLineNameProperty, waterStressesCategoryName, "Stijghoogtelijn", "De stijghoogtelijn behorend bij de zone.", true); }