Exemple #1
0
        public void Constructor_ExpectedValues()
        {
            // Setup
            var failureMechanism = new HeightStructuresFailureMechanism();

            // Call
            var properties = new TestHeightStructuresFailureMechanismProperties(
                failureMechanism, new HeightStructuresFailureMechanismPropertiesBase.ConstructionProperties());

            // Assert
            Assert.IsInstanceOf <ObjectProperties <HeightStructuresFailureMechanism> >(properties);
            Assert.AreEqual(failureMechanism.Name, properties.Name);
            Assert.AreEqual(failureMechanism.Code, properties.Code);
        }
Exemple #2
0
        public void Constructor_Always_PropertiesHaveExpectedAttributeValues()
        {
            // Setup
            var failureMechanism = new HeightStructuresFailureMechanism();

            // Call
            var properties = new TestHeightStructuresFailureMechanismProperties(
                failureMechanism, new HeightStructuresFailureMechanismPropertiesBase.ConstructionProperties
            {
                NamePropertyIndex = namePropertyIndex,
                CodePropertyIndex = codePropertyIndex
            });

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

            Assert.AreEqual(2, dynamicProperties.Count);

            const string generalCategory = "Algemeen";

            PropertyDescriptor nameProperty = dynamicProperties[namePropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(nameProperty,
                                                                            generalCategory,
                                                                            "Naam",
                                                                            "De naam van het faalmechanisme.",
                                                                            true);

            PropertyDescriptor labelProperty = dynamicProperties[codePropertyIndex];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(labelProperty,
                                                                            generalCategory,
                                                                            "Label",
                                                                            "Het label van het faalmechanisme.",
                                                                            true);
        }