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); }
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")); }