public void OptionWithNullDescription() { var option = new CommandLineParameters.OptionInfo("filename|f", null, "output.txt"); // ReSharper disable once StringCompareIsCultureSpecific.1 Assert.IsTrue(string.Compare(String.Empty, option.Description) == 0); }
public void NullTypeInOptionInfo() { #pragma warning disable 168 var option = new CommandLineParameters.OptionInfo("foo", "dummy", null); #pragma warning restore 168 Expect(false, "OptionInfo ctor should throw exception on null type."); }
public void NonIntegerOptionAsInteger() { var option = new CommandLineParameters.OptionInfo("foo", "a string", typeof(string)) { IntegerValue = 42 }; Expect(false, "Setting a string option to an integer value should throw an exception."); }
public void NonStringOptionAsString() { var option = new CommandLineParameters.OptionInfo("foo", "a number", typeof(int)) { StringValue = "bar" }; Expect(false, "Setting an integer option to a boolean value should throw an exception."); }
public void NonBooleanOptionAsBoolean() { var option = new CommandLineParameters.OptionInfo("foo", "a number", typeof(int)) { BooleanValue = true }; Expect(false, "Setting an integer option to a boolean value should throw an exception."); }
public void OptionalOptionWithEmptyName() { var option = new CommandLineParameters.OptionInfo("", "description", "foo"); }
public void OptionalOptionWithNullName() { var option = new CommandLineParameters.OptionInfo(null, "description", "foo"); }
public void RequiredOptionWithEmptyName() { var option = new CommandLineParameters.OptionInfo("", "description", typeof(string)); }