コード例 #1
0
        public void ArgumentsParser_Singlearg_Seperated_Test()
        {
            var result = "";

            var expected = "testarg";

            var argsParser = new ArgumentsParser(
               new Dictionary<string, Action<string>>() { { "t", s => result = s } });
            argsParser.ParseArgs(new string[] { "t", expected });
            Assert.Equal(expected, result);
        }
コード例 #2
0
        public void ArgumentsParser_Singlearg_WrappedByQuotes_Test()
        {
            var result = "";

            var expected = "testarg";
            var testArgument = "t=\"" + expected + "\"";

            var argsParser = new ArgumentsParser(
               new Dictionary<string, Action<string>>() { { "t", s => result = s } });
            argsParser.ParseArgs(new string[] { testArgument });
            Assert.Equal(expected, result);
        }