BadScript 2
Loading...
Searching...
No Matches
ParserSettingsTests.cs
Go to the documentation of this file.
1using System.IO;
2using Xunit;
3using FluentAssertions;
4
6{
7 public class ParserSettingsTests
8 {
9 public class DisposeTrackingStringWriter : StringWriter
10 {
12 {
13 Disposed = false;
14 }
15
16 public bool Disposed { get; private set; }
17
18 protected override void Dispose(bool disposing)
19 {
20 Disposed = true;
21 base.Dispose(disposing);
22 }
23 }
24
25 [Fact]
27 {
29 {
30 using (ParserSettings parserSettings = new ParserSettings())
31 {
32 parserSettings.HelpWriter = textWriter;
33 }
34
35 textWriter.Disposed.Should().BeFalse("not disposed");
36 }
37 }
38 }
39}
Provides settings for CommandLine.Parser. Once consumed cannot be reused.