Ejemplo n.º 1
0
        public void ConvertCommandLineArgsToArguments_should_throw_ArgumentNullException_if_passed_parameter_is_null()
        {
            // Arrange
            var commandLineArgs = default(string[]);

            // Act, Assert
            Assert.Throws <ArgumentNullException>(() => ProcessMixin.ConvertCommandLineArgsToArguments(commandLineArgs));
        }
Ejemplo n.º 2
0
        public void ConvertCommandLineArgsToArguments_should_ignore_the_first_element()
        {
            // Arrange
            var commandLineArgs = new[] { "a a a" };

            // Act
            var result = ProcessMixin.ConvertCommandLineArgsToArguments(commandLineArgs);

            // Assert
            Assert.AreEqual(string.Empty, result);
        }
Ejemplo n.º 3
0
        public void ConvertCommandLineArgsToArguments_should_not_enclose_by_double_quote_if_there_is_no_delimiter()
        {
            // Arrange
            var commandLineArgs = new[] { "a", "bbb" };

            // Act
            var result = ProcessMixin.ConvertCommandLineArgsToArguments(commandLineArgs);

            // Assert
            Assert.AreEqual("bbb", result);
        }
Ejemplo n.º 4
0
        public void ConvertCommandLineArgsToArguments_should_enclose_by_double_quote_if_an_arg_contains_tab()
        {
            // Arrange
            var commandLineArgs = new[] { "a", "b\tb" };

            // Act
            var result = ProcessMixin.ConvertCommandLineArgsToArguments(commandLineArgs);

            // Assert
            Assert.AreEqual("\"b\tb\"", result);
        }
Ejemplo n.º 5
0
        public void ConvertCommandLineArgsToArguments_should_return_empty_if_passed_parameter_is_empty()
        {
            // Arrange
            var commandLineArgs = new string[0];

            // Act
            var result = ProcessMixin.ConvertCommandLineArgsToArguments(commandLineArgs);

            // Assert
            Assert.AreEqual(string.Empty, result);
        }