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)); }
public void BriefLabel_SetProperty_ResultIsEqual(String actual, String expected) { SwitchParameterAttribute attribute = new SwitchParameterAttribute() { BriefLabel = actual }; Assert.AreEqual(attribute.BriefLabel, expected); }
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); }
public void BriefLabel_SetProperty_ThrowsException(String actual) { SwitchParameterAttribute attribute = new SwitchParameterAttribute(); Assert.Throws <SwitchAttributeException>(() => { attribute.BriefLabel = actual; }); }