Ejemplo n.º 1
0
        public void GetHelp_NoParam()
        {
            var sw1 = new CommandSwitch("switch", 's');

            sw1.AddAlternativeNames("alt");
            sw1.SetHelp("Help here");

            StringBuilder sb = new StringBuilder();

            sw1.GetHelp(new Setup(), sb);
            var actual   = sb.ToString();
            var expected = " -s --switch, --alt       Help here\n";

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void GetHelp_WithAltNamesNoLongname_CorrectDisplay()
        {
            var sw1 = new CommandSwitch("s");

            sw1.AddAlternativeNames("alternative");
            sw1.SetHelp("Help here");

            StringBuilder sb = new StringBuilder();

            sw1.GetHelp(new Setup(), sb);
            var actual   = sb.ToString();
            var expected = " -s --alternative         Help here\n";

            Assert.AreEqual(expected, actual);
        }