/src/tests/Parser/ParserConfiguratorFixture.cs
C# | 33 lines | 29 code | 2 blank | 2 comment | 0 complexity | 91f728f942e20e052f70b0d4ae72a5a8 MD5 | raw file
Possible License(s): Apache-2.0
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Text;
- using Xunit;
- using FluentAssertions;
- namespace CommandLine.Tests
- {
- public class ParserConfiguratorFixture
- {
- [Fact]
- public void Should_be_configured_with_configurator()
- {
- // Given when
- var helpWriter = new StringWriter();
- var parser = new CommandLine.Parser(with =>
- {
- with.NoCaseSensitive();
- with.HelpWriter(helpWriter);
- with.EnableMutuallyExclusive();
- with.IgnoreUnknownArguments();
- });
- // Than
- parser.Settings.CaseSensitive.Should().BeFalse();
- parser.Settings.HelpWriter.Should().Be(helpWriter);
- parser.Settings.MutuallyExclusive.Should().BeTrue();
- parser.Settings.IgnoreUnknownArguments.Should().BeTrue();
- }
- }
- }