예제 #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);
        }
예제 #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.");
        }
예제 #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.");
        }
예제 #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.");
        }
예제 #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.");
        }
예제 #6
0
 public void OptionalOptionWithEmptyName()
 {
     var option = new CommandLineParameters.OptionInfo("", "description", "foo");
 }
예제 #7
0
 public void OptionalOptionWithNullName()
 {
     var option = new CommandLineParameters.OptionInfo(null, "description", "foo");
 }
예제 #8
0
 public void RequiredOptionWithEmptyName()
 {
     var option = new CommandLineParameters.OptionInfo("", "description", typeof(string));
 }