public void Setting_help_writer_using_constructor()
        {
            var writer = new StringWriter();
            IParser parser = new Parser(new ParserSettings(writer));
            var options = new SimpleOptionsWithHelpOption();

            bool success = parser.ParseArguments(new string[] {"--help"}, options);

            success.Should().BeFalse();
            writer.ToString().Should().Be("MockOptions::GetUsage()");
        }
        public void SettingHelpWriterUsingArgument()
        {
            var writer = new StringWriter();
            ICommandLineParser parser = new CommandLineParser(new CommandLineParserSettings());
            var options = new SimpleOptionsWithHelpOption();

            bool success = parser.ParseArguments(new string[] { "--help" }, options, writer);

            Assert.AreEqual(false, success);
            Assert.AreEqual("MockOptions::GetUsage()", writer.ToString());
        }
        public void SettingHelpWriterUsingConstructor()
        {
            var writer = new StringWriter();
            ICommandLineParser parser = new CommandLineParser(new CommandLineParserSettings(writer));
            var options = new SimpleOptionsWithHelpOption();
            
            bool success = parser.ParseArguments(new string[] {"--help"}, options);

            Assert.AreEqual(false, success);
            Assert.AreEqual("MockOptions::GetUsage()", writer.ToString(System.Globalization.CultureInfo.InvariantCulture)); 
        }
        public void SettingHelpWriterUsingConstructor()
        {
            var writer = new StringWriter();
            ICommandLineParser parser = new CommandLineParser(new CommandLineParserSettings(writer));
            var options = new SimpleOptionsWithHelpOption();

            bool success = parser.ParseArguments(new string[] {"--help"}, options);

            success.Should().Be.False();
            writer.ToString().Should().Equal("MockOptions::GetUsage()");
        }
        public void Setting_help_writer_using_property()
        {
            var writer = new StringWriter();
            var settings = new CommandLineParserSettings();
            settings.HelpWriter = writer;
            ICommandLineParser parser = new CommandLineParser(settings);
            var options = new SimpleOptionsWithHelpOption();

            bool success = parser.ParseArguments(new string[] { "--help" }, options);

            success.Should().BeFalse();
            writer.ToString().Should().Be("MockOptions::GetUsage()");
        }