Esempio n. 1
0
        public void HelpBuilding_BuildingFullHelp_OutputsVersionInformationToHelp()
        {
            //Arrange
            var command = new SubCommand();
            var builder = new HelpBuilder(command, command.Help);

            //Act
            builder.BuildHelp();

            //Assert
            Assert.Equal("1.0.0.0", command.Help.Version);
        }
Esempio n. 2
0
        public void HelpBuilding_BuildingFullHelp_OutputsAllOptionsToHelp()
        {
            //Arrange
            var command = new SubCommand();
            var builder = new HelpBuilder(command, command.Help);

            //Act
            builder.BuildHelp();

            //Assert
            Assert.Contains("-s|--long", command.Help.Usage);
            Assert.Contains("--long-type-option", command.Help.Usage);
        }
Esempio n. 3
0
        public void HelpBuilding_BuildingFullHelp_OutputsAllArgumentsToHelp()
        {
            //Arrange
            var command = new SubCommand();
            var builder = new HelpBuilder(command, command.Help);

            //Act
            builder.BuildHelp();

            //Assert
            Assert.Contains("simple-argument", command.Help.Usage);
            Assert.Contains("custom-argument", command.Help.Usage);
        }
Esempio n. 4
0
        public void HelpBuilding_BuildingFullHelp_OutputsAllSubCommandsToHelp()
        {
            //Arrange
            var command = new MainCommand();
            var builder = new HelpBuilder(command, command.Help);

            //Act
            builder.BuildHelp();

            //Assert
            Assert.Contains("inherited-command", command.Help.Usage);
            Assert.Contains("required", command.Help.Usage);
            Assert.Contains("subcommand", command.Help.Usage);
        }
Esempio n. 5
0
        void ToolStripButton1Click(object sender, EventArgs e)
        {
            // TODO: Implement ToolStripButton1Click
            builder.Clear();
            string output_file = builder.BuildHelp(project.files.ToArray());

            if (output_file != null)
            {
                Help.ShowHelp(null, output_file);
            }
            else
            {
                ClearStatusLine();
            }
        }
Esempio n. 6
0
        public void HelpBuilding_BuildingFullHelp_OutputsUsageInformationToHelp()
        {
            //Arrange
            var command = new SubCommand();

            command.AppInfo.AppName = "TestConsoleApp";

            var builder = new HelpBuilder(command, command.Help);

            //Act
            builder.BuildHelp();

            //Assert
            Assert.Contains("Usage: TestConsoleApp subcommand [arguments] [options]", command.Help.Usage);
        }