示例#1
0
        public void IsVerbalParameter_ArgumentProcessorSettingWithAttribute_ResultAsExpected(Type type, Boolean expected)
        {
            ParameterObjectAttribute attribute = null;

            if (type == typeof(SwitchParameterAttribute))
            {
                attribute = new SwitchParameterAttribute();
            }
            else if (type == typeof(OptionParameterAttribute))
            {
                attribute = new OptionParameterAttribute();
            }
            else if (type == typeof(VerbalParameterAttribute))
            {
                attribute = new VerbalParameterAttribute();
            }
            else if (type == typeof(UnsupportedParameterAttribute))
            {
                attribute = new UnsupportedParameterAttribute();
            }

            ArgumentProcessorSetting setting = new ArgumentProcessorSetting(new TestPropertyInfo(typeof(Object)), attribute);

            Assert.That(setting.IsVerbalParameter(), Is.EqualTo(expected));
        }
示例#2
0
        public void BriefLabel_SetProperty_ResultIsEqual(String actual, String expected)
        {
            SwitchParameterAttribute attribute = new SwitchParameterAttribute()
            {
                BriefLabel = actual
            };

            Assert.AreEqual(attribute.BriefLabel, expected);
        }
示例#3
0
        public void IsConverterSupported_WrongParameterObjectAttributeType_ResultIsFalse(Type type)
        {
            ParameterObjectAttribute attribute = null;

            if (type == typeof(SwitchParameterAttribute))
            {
                attribute = new SwitchParameterAttribute();
            }
            else if (type == typeof(VerbalParameterAttribute))
            {
                attribute = new VerbalParameterAttribute();
            }
            else if (type == typeof(UnsupportedParameterAttribute))
            {
                attribute = new UnsupportedParameterAttribute();
            }

            Assert.That(attribute.IsConverterSupported(null), Is.False);
        }
示例#4
0
        public void BriefLabel_SetProperty_ThrowsException(String actual)
        {
            SwitchParameterAttribute attribute = new SwitchParameterAttribute();

            Assert.Throws <SwitchAttributeException>(() => { attribute.BriefLabel = actual; });
        }