예제 #1
0
        public void Constructor_WithData_ReturnExpectedValues()
        {
            // Setup
            const string someFilePath = "location/to/a/file";
            var          collection   = new MacroStabilityInwardsSurfaceLineCollection();

            collection.AddRange(Enumerable.Empty <MacroStabilityInwardsSurfaceLine>(), someFilePath);

            // Call
            var properties = new MacroStabilityInwardsSurfaceLineCollectionProperties(collection);

            // Assert
            Assert.IsInstanceOf <ObjectProperties <MacroStabilityInwardsSurfaceLineCollection> >(properties);
            Assert.AreSame(collection, properties.Data);
            Assert.AreEqual(someFilePath, properties.SourcePath);
        }
예제 #2
0
        public void Constructor_WithData_PropertiesHaveExpectedAttributesValues()
        {
            // Setup
            var collection = new MacroStabilityInwardsSurfaceLineCollection();

            // Call
            var properties = new MacroStabilityInwardsSurfaceLineCollectionProperties(collection);

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

            Assert.AreEqual(1, dynamicProperties.Count);

            PropertyDescriptor surfaceLineCollectionProperty = dynamicProperties[0];

            Assert.IsNotNull(surfaceLineCollectionProperty);
            Assert.IsTrue(surfaceLineCollectionProperty.IsReadOnly);
            Assert.AreEqual("Algemeen", surfaceLineCollectionProperty.Category);
            Assert.AreEqual("Bronlocatie", surfaceLineCollectionProperty.DisplayName);
            Assert.AreEqual(
                "De locatie van het bestand waaruit de profielschematisaties zijn geïmporteerd.",
                surfaceLineCollectionProperty.Description);
        }