示例#1
0
        public void TestSize()
        {
            var args = new[]
            {
                new [] {
                    "-s",
                    "c:/test.txt"
                },
                new [] {
                    "--s",
                    "c:/test.txt"
                },
                new [] {
                    "/s",
                    "c:/test.txt"
                },
                new [] {
                    "--size",
                    "c:/test.txt"
                }
            };

            foreach (var argPair in args)
            {
                var argumentManipulator = new ArgumentManipulator(argPair);
                var result = argumentManipulator.Execute();
                Assert.IsTrue(TestSize(result));
            }
        }
示例#2
0
        public void TestVersion()
        {
            var args = new[]
            {
                new [] {
                    "-v",
                    "c:/test.txt"
                },
                new [] {
                    "--v",
                    "c:/test.txt"
                },
                new [] {
                    "/v",
                    "c:/test.txt"
                },
                new [] {
                    "--version",
                    "c:/test.txt"
                }
            };

            foreach (var argPair in args)
            {
                var argumentManipulator = new ArgumentManipulator(argPair);
                var result = argumentManipulator.Execute();
                Assert.IsTrue(RegexCheckVersion(result));
            }
        }
示例#3
0
        public void WrongNumberOfArguments2()
        {
            var args = new[] { "-v", "c:/test.txt", "I am not supposed to be here" };
            var argumentManipulator = new ArgumentManipulator(args);
            var result = argumentManipulator.Execute();

            Assert.AreEqual("", result);
        }
示例#4
0
        public void UnsupportedArgument()
        {
            var args = new[] { "-d", "c:/test.txt" };
            var argumentManipulator = new ArgumentManipulator(args);
            var result = argumentManipulator.Execute();

            Assert.AreEqual("", result);
        }
示例#5
0
        public void WrongNumberOfArguments()
        {
            var args = new[] { "-v" };
            var argumentManipulator = new ArgumentManipulator(args);
            var result = argumentManipulator.Execute();

            Assert.AreEqual("", result);
        }