Beispiel #1
0
        public void ParseInvalidLongName2()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");

            int i = 1;
            var result = argument.Parse(new[] { "/switch1", "--switch:" }, ref i);
            Assert.IsNull(result);
            Assert.AreEqual(1, i);
        }
Beispiel #2
0
        public void ParseInvalidLongName1()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "-switch" }, ref i);

            Assert.IsNull(result);
            Assert.AreEqual(1, i);
        }
Beispiel #3
0
        public void ParseLongName2()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "--SwItcH" }, ref i);

            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #4
0
        public void ParseOther()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' });

            int i      = 0;
            var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i);

            Assert.IsNull(result);
            Assert.AreEqual(0, i);
        }
Beispiel #5
0
        public void ParseShortNameAlias()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S', 'A' });

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "-A" }, ref i);

            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #6
0
        public void ParseInvalidShortName3()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' });

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "--S" }, ref i);

            Assert.IsNull(result);
            Assert.AreEqual(1, i);
        }
Beispiel #7
0
        public void ParseLongNameAlias()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", new[] { "Alias" }, null);

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "--alias" }, ref i);

            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #8
0
        public void ParseLongName1()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");

            Assert.IsFalse(string.IsNullOrEmpty(argument.GetSyntax()));
            Assert.IsTrue(string.IsNullOrEmpty(argument.GetHelp()));

            int i      = 1;
            var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i);

            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #9
0
        public void ParseInvalidShortName3()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' });

            int i = 1;
            var result = argument.Parse(new[] { "--switch1", "--S" }, ref i);
            Assert.IsNull(result);
            Assert.AreEqual(1, i);
        }
Beispiel #10
0
        public void ParseShortNameAlias()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S', 'A' });

            int i = 1;
            var result = argument.Parse(new[] { "--switch1", "-A" }, ref i);
            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #11
0
        public void ParseOther()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", null, new[] { 'S' });

            int i = 0;
            var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i);
            Assert.IsNull(result);
            Assert.AreEqual(0, i);
        }
Beispiel #12
0
        public void ParseLongNameAlias()
        {
            SwitchArgument argument = new SwitchArgument("switch", "", new[] { "Alias" }, null);

            int i = 1;
            var result = argument.Parse(new[] { "--switch1", "--alias" }, ref i);
            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #13
0
        public void ParseLongName2()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");

            int i = 1;
            var result = argument.Parse(new[] { "--switch1", "--SwItcH" }, ref i);
            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }
Beispiel #14
0
        public void ParseLongName1()
        {
            SwitchArgument argument = new SwitchArgument("switch", "");
            Assert.IsFalse(string.IsNullOrEmpty(argument.GetSyntax()));
            Assert.IsTrue(string.IsNullOrEmpty(argument.GetHelp()));

            int i = 1;
            var result = argument.Parse(new[] { "--switch1", "--switch" }, ref i);
            Assert.IsNotNull(result);
            Assert.AreEqual(2, i);
        }