public void Constructor_Always_PropertiesHaveExpectedAttributeValues() { // Call var properties = new TestWaveImpactAsphaltCoverFailureMechanismProperties( new WaveImpactAsphaltCoverFailureMechanism(), new WaveImpactAsphaltCoverFailureMechanismPropertiesBase.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 codeProperty = dynamicProperties[codePropertyIndex]; PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(codeProperty, generalCategory, "Label", "Het label van het faalmechanisme.", true); }
public void Constructor_ExpectedValues() { // Setup var failureMechanism = new WaveImpactAsphaltCoverFailureMechanism(); // Call var properties = new TestWaveImpactAsphaltCoverFailureMechanismProperties( failureMechanism, new WaveImpactAsphaltCoverFailureMechanismPropertiesBase.ConstructionProperties()); // Assert Assert.IsInstanceOf <ObjectProperties <WaveImpactAsphaltCoverFailureMechanism> >(properties); Assert.AreSame(failureMechanism, properties.Data); Assert.AreEqual(failureMechanism.Name, properties.Name); Assert.AreEqual(failureMechanism.Code, properties.Code); }