示例#1
0
        public void Constructor_ExpectedValues()
        {
            // Setup & Call
            var properties = new BreakWaterProperties();

            // Assert
            Assert.IsInstanceOf <ObjectProperties <ForeshoreProfile> >(properties);
            Assert.IsNull(properties.Data);
            Assert.IsEmpty(properties.ToString());
        }
示例#2
0
        public void Data_SetForeshoreProfileInstanceWithoutBreakWater_ReturnCorrectPropertyValues()
        {
            // Setup
            var foreshoreProfile = new TestForeshoreProfile();

            var properties = new BreakWaterProperties();

            // Call
            properties.Data = foreshoreProfile;

            // Assert
            Assert.IsFalse(properties.HasBreakWater);
        }
示例#3
0
        public void Data_SetForeshoreProfileInstanceWithBreakWater_ReturnCorrectPropertyValues()
        {
            // Setup
            var foreshoreProfile = new TestForeshoreProfile(new BreakWater(BreakWaterType.Wall, 10.0));

            var properties = new BreakWaterProperties();

            // Call
            properties.Data = foreshoreProfile;

            // Assert
            Assert.IsTrue(properties.HasBreakWater);
            Assert.AreEqual(BreakWaterType.Wall, properties.BreakWaterType);
            Assert.AreEqual(10.0, properties.BreakWaterHeight.Value);
        }
示例#4
0
        public void PropertyAttributes_SetForeshoreProfileInstanceWithBreakWater_ReturnExpectedValues()
        {
            // Setup
            var foreshoreProfile = new TestForeshoreProfile(new BreakWater(BreakWaterType.Caisson, 10.0));

            // Call
            var properties = new BreakWaterProperties
            {
                Data = foreshoreProfile
            };

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

            Assert.AreEqual(3, dynamicProperties.Count);

            PropertyDescriptor useBreakWaterProperty = dynamicProperties[0];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useBreakWaterProperty,
                                                                            "Misc",
                                                                            "Aanwezig",
                                                                            "Is er een dam aanwezig?",
                                                                            true);

            PropertyDescriptor breakWaterTypeProperty = dynamicProperties[1];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(breakWaterTypeProperty,
                                                                            "Misc",
                                                                            "Type",
                                                                            "Het type van de dam.",
                                                                            true);

            PropertyDescriptor breakWaterHeightProperty = dynamicProperties[2];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(breakWaterHeightProperty,
                                                                            "Misc",
                                                                            "Hoogte [m+NAP]",
                                                                            "De hoogte van de dam.",
                                                                            true);
        }
示例#5
0
        public void PropertyAttributes_SetForeshoreProfileInstanceWithoutBreakWater_ReturnExpectedValues()
        {
            // Setup
            var foreshoreProfile = new TestForeshoreProfile();

            // Call
            var properties = new BreakWaterProperties
            {
                Data = foreshoreProfile
            };

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

            Assert.AreEqual(1, dynamicProperties.Count);

            PropertyDescriptor useBreakWaterProperty = dynamicProperties[0];

            PropertiesTestHelper.AssertRequiredPropertyDescriptorProperties(useBreakWaterProperty,
                                                                            "Misc",
                                                                            "Aanwezig",
                                                                            "Is er een dam aanwezig?",
                                                                            true);
        }