Beispiel #1
0
        public void Constructor_ValidStochasticSoilModel_ExpectedValues()
        {
            // Setup
            PipingStochasticSoilModel stochasticSoilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel();

            // Call
            var properties = new PipingStochasticSoilModelProperties(stochasticSoilModel);

            // Assert
            Assert.IsInstanceOf <ObjectProperties <PipingStochasticSoilModel> >(properties);
            TestHelper.AssertTypeConverter <PipingStochasticSoilModelProperties, ExpandableArrayConverter>(nameof(PipingStochasticSoilModelProperties.Geometry));
            TestHelper.AssertTypeConverter <PipingStochasticSoilModelProperties, ExpandableArrayConverter>(nameof(PipingStochasticSoilModelProperties.StochasticSoilProfiles));
            Assert.AreSame(stochasticSoilModel, properties.Data);
        }
Beispiel #2
0
        public void GetProperties_WithData_ReturnExpectedValues()
        {
            // Setup
            var stochasticSoilModel = new PipingStochasticSoilModel("Name", new[]
            {
                new Point2D(1.0, 2.0)
            }, new[]
            {
                new PipingStochasticSoilProfile(1.0, PipingSoilProfileTestFactory.CreatePipingSoilProfile())
            });

            // Call
            var properties = new PipingStochasticSoilModelProperties(stochasticSoilModel);

            // Assert
            Assert.AreEqual(stochasticSoilModel.Name, properties.Name);
            CollectionAssert.AreEqual(stochasticSoilModel.Geometry, properties.Geometry);

            PipingStochasticSoilProfile[] stochasticSoilProfiles = stochasticSoilModel.StochasticSoilProfiles.ToArray();
            Assert.AreEqual(stochasticSoilProfiles.Length, properties.StochasticSoilProfiles.Length);
            Assert.AreSame(stochasticSoilProfiles[0], properties.StochasticSoilProfiles[0].Data);
        }
Beispiel #3
0
        public void Constructor_Always_PropertiesHaveExpectedAttributesValues()
        {
            // Setup
            PipingStochasticSoilModel stochasticSoilModel = PipingStochasticSoilModelTestFactory.CreatePipingStochasticSoilModel();

            // Call
            var properties = new PipingStochasticSoilModelProperties(stochasticSoilModel);

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

            Assert.AreEqual(3, dynamicProperties.Count);

            PropertyDescriptor stochasticSoilModelNameProperty = dynamicProperties[stochasticSoilModelNamePropertyIndex];

            Assert.IsNotNull(stochasticSoilModelNameProperty);
            Assert.IsTrue(stochasticSoilModelNameProperty.IsReadOnly);
            Assert.AreEqual("Algemeen", stochasticSoilModelNameProperty.Category);
            Assert.AreEqual("Naam", stochasticSoilModelNameProperty.DisplayName);
            Assert.AreEqual("Naam van het stochastische ondergrondmodel.", stochasticSoilModelNameProperty.Description);

            PropertyDescriptor stochasticSoilModelGeometryProperty = dynamicProperties[stochasticSoilModelGeometryPropertyIndex];

            Assert.IsNotNull(stochasticSoilModelGeometryProperty);
            Assert.IsTrue(stochasticSoilModelGeometryProperty.IsReadOnly);
            Assert.AreEqual("Algemeen", stochasticSoilModelGeometryProperty.Category);
            Assert.AreEqual("Geometrie", stochasticSoilModelGeometryProperty.DisplayName);
            Assert.AreEqual("Geometrie uit de database.", stochasticSoilModelGeometryProperty.Description);

            PropertyDescriptor stochasticSoilModelStochasticSoilProfilesProperty = dynamicProperties[stochasticSoilModelStochasticSoilProfilesPropertyIndex];

            Assert.IsNotNull(stochasticSoilModelStochasticSoilProfilesProperty);
            Assert.IsTrue(stochasticSoilModelStochasticSoilProfilesProperty.IsReadOnly);
            Assert.AreEqual("Algemeen", stochasticSoilModelStochasticSoilProfilesProperty.Category);
            Assert.AreEqual("Ondergrondschematisaties", stochasticSoilModelStochasticSoilProfilesProperty.DisplayName);
            Assert.AreEqual("Ondergrondschematisaties uit de database.", stochasticSoilModelStochasticSoilProfilesProperty.Description);
        }