Ejemplo n.º 1
0
        public void Construction_TestClassConverter_CustomConverterIsEnabled()
        {
            TestClassConverter candidate = new TestClassConverter();

            PropertyInfo             property  = candidate.GetType().GetRuntimeProperty("TestType");
            ParameterObjectAttribute attribute = (ParameterObjectAttribute)property.GetCustomAttribute(typeof(OptionParameterAttribute));

            ArgumentProcessorSetting actual = new ArgumentProcessorSetting(property, attribute, true);

            Assert.That(actual.CustomConverter, Is.Not.Null);
            Assert.That(actual.HasCustomConverter, Is.True);
        }
Ejemplo n.º 2
0
        public void InvokeCustomConverter_ConvertMethodInvocation_ParametersAsExpected()
        {
            TestClassConverter candidate = new TestClassConverter();

            PropertyInfo             property  = candidate.GetType().GetRuntimeProperty("TestType");
            ParameterObjectAttribute attribute = (ParameterObjectAttribute)property.GetCustomAttribute(typeof(OptionParameterAttribute));

            ArgumentProcessorSetting actual = new ArgumentProcessorSetting(property, attribute, true);

            actual.InvokeCustomConverter("parameter", "argument", "delimiter");

            Assert.That(ArgumentProcessorSettingTests.parameter, Is.EqualTo("parameter"));
            Assert.That(ArgumentProcessorSettingTests.argument, Is.EqualTo("argument"));
            Assert.That(ArgumentProcessorSettingTests.delimiter, Is.EqualTo("delimiter"));
        }