コード例 #1
0
        public void CanCallDisplayHelp()
        {
            var stdOut = new StdOutStringWriter();

            _testClass.Console = stdOut;
            _testClass.DisplayHelp();
            var result = stdOut.ToString();

            Assert.NotEmpty(result);
        }
コード例 #2
0
        public void CanCallUseDescription()
        {
            var description = "TestValue255568780";
            var stdOut      = new StdOutStringWriter();

            _testClass.Console = stdOut;
            _testClass.UseDescription(description);
            _testClass.DisplayHelp();
            var result = stdOut.ToString();

            Assert.NotEmpty(result);
            Assert.Contains(description, result);
        }
コード例 #3
0
        public void CanCallUseDefaultHelp()
        {
            var stdOut = new StdOutStringWriter();

            _testClass.Console = stdOut;
            _testClass.UseDefaultHelp();
            _testClass.DisplayHelp();
            var result = stdOut.ToString();

            Assert.NotEmpty(result);

            Assert.Equal(
                "Help:" + Environment.NewLine +
                "Key  Description" + Environment.NewLine +
                "help Shows application help" + Environment.NewLine +
                "Arguments are parsed as" + Environment.NewLine +
                "Key:Value" + Environment.NewLine, result);
        }