コード例 #1
0
        public void GlobalHelp_Prints_CommandNames_Alphabetically()
        {
            var c3 = new TestCommand4("Zed");
            var c1 = new TestCommand();
            var c2 = new TestCommand2();

            underTest.AddCommand(c3);
            underTest.AddCommand(c2);
            underTest.AddCommand(c1);

            Options.Instance.ColorizeConsoleOutput = false;

            underTest.ExecuteCommand("-h");

            var expected = @"Listing the commands available for 'app'
-----
testCommand (test)      Test command help.
testCommand2 (tc2)      Test command 2 help.
zed                     Test command 4 help.
-----
";

            Assert.IsTrue(
                testWriter.ToString() == expected);

            Options.Instance.ColorizeConsoleOutput = true;
        }
コード例 #2
0
        public void AddCommand_AllowsMultiple_CustomName()
        {
            var expected = RegisterResult.Success;
            var c1       = new TestCommand4("CustomName1");
            var c2       = new TestCommand4("ADifferentName");

            Assert.IsTrue(underTest.AddCommand(c1) == expected);
            Assert.IsTrue(underTest.AddCommand(c2) == expected);
        }