Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
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.");
        }
Ejemplo n.º 3
0
        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.");
        }
Ejemplo n.º 4
0
        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.");
        }
Ejemplo n.º 5
0
        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.");
        }
Ejemplo n.º 6
0
 public void OptionalOptionWithEmptyName()
 {
     var option = new CommandLineParameters.OptionInfo("", "description", "foo");
 }
Ejemplo n.º 7
0
 public void OptionalOptionWithNullName()
 {
     var option = new CommandLineParameters.OptionInfo(null, "description", "foo");
 }
Ejemplo n.º 8
0
 public void RequiredOptionWithEmptyName()
 {
     var option = new CommandLineParameters.OptionInfo("", "description", typeof(string));
 }