예제 #1
0
        /// <summary>
        /// Shows the help for this command line utility tool. It prints out the help display, and can be overridden.
        /// </summary>
        /// <param name="args"></param>
        /// <returns></returns>
        private int ShowHelp()
        {
            ConsoleLogger.PrintLine("");
            ConsoleLogger.PrintLine("NAME");
            ConsoleLogger.PrintLine(_name + " Version " + Version);
            ConsoleLogger.PrintLine("");
            ConsoleLogger.PrintLine("SYNOPSIS");
            ConsoleLogger.PrintLine(_synopsis);
            ConsoleLogger.PrintLine("");
            ConsoleLogger.PrintLine("DESCRIPTION");
            ConsoleLogger.PrintLine(_description);
            ConsoleLogger.PrintLine("");
            ConsoleLogger.PrintLine("COMMANDS");
            if (hasDefaultCommand)
            {
                ConsoleLogger.PrintLine(DefaultCommand.ToString());
                ConsoleLogger.PrintLine("");
            }
            foreach (ConsoleCommand c in _commands.Values)
            {
                ConsoleLogger.PrintLine(c.ToString());
                ConsoleLogger.PrintLine("");
            }

            return(0);
        }
예제 #2
0
        public void ToStringTest()
        {
            // Arrange
            var componentUnderTest = new DefaultCommand();
            var expected           = "[OnAuthoriseCalled:False] [OnAfterExecuteCalled:False] [OnAfterExecuteCalledWithException:False] [OnBeforeInitialiseTargetCalled:False] [OnInitialiseTargetCalled:False] [OnExecuteCalled:False]";

            // Act
            var actual = componentUnderTest.ToString();

            // Assert
            actual.ShouldHaveSameValueAs(expected);
        }