Ejemplo n.º 1
0
        public void CommandWithTwoParams_NoArgumentProvided_BuildsCorrectly()
        {
            CommandWithTwoParams command = new CommandWithTwoParams();

            string        expected = "command";
            SyntaxBuilder target   = new SyntaxBuilder(command);
            string        actual   = target.ToString();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void CommandWithRequiredParam_ArgumentNotProvided_ExceptionThrown()
        {
            const int argument1 = 0;
            CommandWithRequiredParam command = new CommandWithRequiredParam();

            string        expected = "command --param1 " + argument1.ToString();
            SyntaxBuilder target   = new SyntaxBuilder(command);
            string        actual   = target.ToString();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void CommandWithRequiredParam_ArgumentProvided_BuildsCorrectly()
        {
            const int argument1 = 0;
            CommandWithRequiredParam command = new CommandWithRequiredParam
            {
                Parameter1 = argument1,
            };

            string        expected = "command --param1 " + argument1.ToString();
            SyntaxBuilder target   = new SyntaxBuilder(command);
            string        actual   = target.ToString();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void CommandWithTwoParams_TwoArgumentProvided_BuildsCorrectly()
        {
            const int            argument1 = 0;
            const int            argument2 = 0;
            CommandWithTwoParams command   = new CommandWithTwoParams
            {
                Parameter1 = argument1,
                Parameter2 = argument2
            };

            string expected = "command --param1 " + argument1.ToString() + " --param2 " +
                              argument2.ToString();
            SyntaxBuilder target = new SyntaxBuilder(command);
            string        actual = target.ToString();

            Assert.AreEqual(expected, actual);
        }