예제 #1
0
        public void SplitArgumentsWithQuotesAtEnd_ReturnsExpected()
        {
            string input = "one \"two three four\"";

            string[] result = CommandArguments.Split(input);

            Assert.Equal(2, result.Length);

            Assert.Equal("one", result[0]);
            Assert.Equal("two three four", result[1]);
        }
예제 #2
0
        public void SplitArgumentsWithQuotesAtBeginning_ReturnsExpected()
        {
            string input = "\"one \"two three four";

            string[] result = CommandArguments.Split(input);

            Assert.Equal(4, result.Length);

            Assert.Equal("one ", result[0]);
            Assert.Equal("two", result[1]);
            Assert.Equal("three", result[2]);
            Assert.Equal("four", result[3]);
        }
예제 #3
0
        public void SplitExtraSpacedArgumentsWithoutQuotes_ReturnsExpected()
        {
            string input = "one two  three four";

            string[] result = CommandArguments.Split(input);

            Assert.Equal(4, result.Length);

            Assert.Equal("one", result[0]);
            Assert.Equal("two", result[1]);
            Assert.Equal("three", result[2]);
            Assert.Equal("four", result[3]);
        }