Ejemplo n.º 1
0
        public void WhenHelpShortParameterSpecifiedThenHelpIsShown()
        {
            var program = new MockedProgram(new string[]
            {
                ParameterUtils.HelpArgumentShortParameter
            });
            program.Execute();

            Assert.AreEqual(true, program.HelpContentDisplayed, "Help content should have been displayed!");
            program.AssertProgramNotRun();
        }
Ejemplo n.º 2
0
        public void WhenCalledWithNoParameterThenMainRoutineIsNotRun()
        {
            var program = new MockedProgram(new string[] { });
            program.Execute();

            Assert.AreEqual(false, program.MainRunRoutineRun, "User should be notified about not feasible execution!");
            Assert.AreEqual(true, program.HelpContentDisplayed, "Help content should have been displayed!");
            program.AssertProgramNotRun();
        }
Ejemplo n.º 3
0
        public void WhenHelpParameterSpecifiedWithOtherParametersThenHelpIsShown()
        {
            var parameters = new string[][]
            {
                new string[]
                {
                    ParameterUtils.HelpArgumentParameter,
                    ParameterUtils.FileArgumentParameter,
                    "file"
                },
                new string[]
                {
                    ParameterUtils.HelpArgumentParameter,
                    ParameterUtils.ProjectArgumentParameter,
                    "project"
                },
                new string[]
                {
                    ParameterUtils.HelpArgumentParameter,
                    ParameterUtils.VerboseArgumentParameter
                },
                new string[]
                {
                    ParameterUtils.HelpArgumentParameter,
                    ParameterUtils.ProjectArgumentParameter,
                    "project",
                    ParameterUtils.FileArgumentParameter,
                    "file"
                }
            };

            foreach (var input in parameters)
            {
                var program = new MockedProgram(input);
                program.Execute();

                Assert.AreEqual(true, program.HelpContentDisplayed, "Help content should have been displayed!");
                program.AssertProgramNotRun();
            }
        }
Ejemplo n.º 4
0
        public void WhenCalledWithNoParameterThenHelpIsShown()
        {
            var program = new MockedProgram(new string[]{ });
            program.Execute();

            Assert.AreEqual(true, program.HelpContentDisplayed, "Help content should have been displayed!");
            program.AssertProgramNotRun();
        }