Exemple #1
0
        public void GetProperties_WithData_ReturnExpectedValues()
        {
            // Setup
            var layer = new MacroStabilityInwardsSoilLayer2D(
                new Ring(new[]
            {
                new Point2D(20.210230, 26.00001),
                new Point2D(3.830, 1.040506)
            }),
                new MacroStabilityInwardsSoilLayerData
            {
                MaterialName = "Test Name",
                IsAquifer    = true
            },
                new[]
            {
                new MacroStabilityInwardsSoilLayer2D(
                    new Ring(new[]
                {
                    new Point2D(12.987, 12.821),
                    new Point2D(4.23, 1.02)
                }))
            });

            // Call
            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(layer);

            // Assert
            Assert.AreEqual(layer.Data.MaterialName, properties.Name);
            CollectionAssert.AreEqual(layer.OuterRing.Points, properties.Geometry);
        }
Exemple #2
0
        public void Constructor_ValidData_PropertiesHaveExpectedAttributeValues()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            // Call
            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(layer);

            // Assert
            PropertyDescriptorCollection dynamicProperties = PropertiesTestHelper.GetAllVisiblePropertyDescriptors(properties);

            Assert.AreEqual(2, dynamicProperties.Count);

            const string generalCategoryName = "Algemeen";

            PropertyDescriptor nameProperty = dynamicProperties[0];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
                                                                            generalCategoryName,
                                                                            "Naam",
                                                                            "De naam van de grondlaag.",
                                                                            true);

            PropertyDescriptor outerRingProperty = dynamicProperties[1];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(outerRingProperty,
                                                                            generalCategoryName,
                                                                            "Geometrie",
                                                                            "De geometrie van de buitenring van deze grondlaag.",
                                                                            true);
        }
Exemple #3
0
        public void GetProperties_WithDataEmptyName_ReturnExpectedValues()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            layer.Data.MaterialName = string.Empty;

            // Call
            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(layer);

            // Assert
            Assert.AreEqual("Onbekend", properties.Name);
        }
Exemple #4
0
        public void Constructor_ValidMacroStabilityInwardsSoilLayer2D_ExpectedValues()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D soilLayer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            // Call
            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(soilLayer);

            // Assert
            Assert.IsInstanceOf <ObjectProperties <MacroStabilityInwardsSoilLayer2D> >(properties);
            TestHelper.AssertTypeConverter <MacroStabilityInwardsSoilLayer2DBaseProperties, ExpandableObjectConverter>();
            TestHelper.AssertTypeConverter <MacroStabilityInwardsSoilLayer2DBaseProperties,
                                            ExpandableArrayConverter>(nameof(MacroStabilityInwardsSoilLayer2DBaseProperties.Geometry));
            Assert.AreSame(soilLayer, properties.Data);
        }
Exemple #5
0
        public void ToString_EmptyName_ReturnsDefaultName()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            layer.Data.MaterialName = string.Empty;

            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(layer);

            // Call
            string name = properties.ToString();

            // Assert
            Assert.AreEqual("Onbekend", name);
        }
Exemple #6
0
        public void ToString_ValidName_ReturnsMaterialName()
        {
            // Setup
            MacroStabilityInwardsSoilLayer2D layer = MacroStabilityInwardsSoilLayer2DTestFactory.CreateMacroStabilityInwardsSoilLayer2D();

            layer.Data.MaterialName = "Layer A 2D";

            var properties = new MacroStabilityInwardsSoilLayer2DBaseProperties(layer);

            // Call
            string name = properties.ToString();

            // Assert
            Assert.AreEqual(layer.Data.MaterialName, name);
        }