BadScript 2
Loading...
Searching...
No Matches
HelpTextAutoBuildFix.cs
Go to the documentation of this file.
1using System;
2using System.Linq;
3using Xunit;
4using FluentAssertions;
7
9{
11 {
12 [Fact]
14 {
15 // Fixture setup
16 // Exercize system
17 var sut = new HelpText { AdditionalNewLineAfterOption = true }
19 Enumerable.Empty<Error>()));
20
21 // Verify outcome
22
23 var lines = sut.ToString().ToLines();
24
25 lines[2].Should().BeEquivalentTo(" stringvalue Define a string value here.");
26 lines[3].Should().BeEquivalentTo(String.Empty);
27 lines[4].Should().BeEquivalentTo(" s, shortandlong Example with both short and long name.");
28 lines[5].Should().BeEquivalentTo(String.Empty);
29 lines[7].Should().BeEquivalentTo(String.Empty);
30 lines[9].Should().BeEquivalentTo(String.Empty);
31 lines[11].Should().BeEquivalentTo(String.Empty);
32 lines[13].Should().BeEquivalentTo(String.Empty);
33 lines[14].Should().BeEquivalentTo(" value pos. 0 Define a long value here.");
34 // Teardown
35 }
36
37 [Fact]
39 {
40 // Fixture setup
41 // Exercize system
42 var sut = new HelpText { AdditionalNewLineAfterOption = false }
44 Enumerable.Empty<Error>()));
45
46 // Verify outcome
47
48 var lines = sut.ToString().ToLines();
49
50 lines[2].Should().BeEquivalentTo(" stringvalue Define a string value here.");
51
52 lines[3].Should().BeEquivalentTo(" s, shortandlong Example with both short and long name.");
53 lines[8].Should().BeEquivalentTo(" value pos. 0 Define a long value here.");
54 // Teardown
55 }
56 [Fact]
58 {
59 // Fixture setup
60 // Exercize system
61 var sut = new HelpText ()
63 Enumerable.Empty<Error>()));
64
65 // Verify outcome
66
67 var lines = sut.ToString().ToNotEmptyLines();
68 lines.Should().HaveCount(c => c ==7);
69 lines.Should().Contain(" help Display more information on a specific command.");
70 lines.Should().Contain(" version Display version information.");
71 // Teardown
72 }
73
74 [Fact]
76 {
77 // Fixture setup
78 // Exercize system
79 var sut = new HelpText { AutoHelp = false,AutoVersion = false}
81 Enumerable.Empty<Error>()));
82
83 // Verify outcome
84
85 var lines = sut.ToString().ToNotEmptyLines();
86 lines.Should().HaveCount(c => c ==5);
87 lines.Should().NotContain(" help Display more information on a specific command.");
88 lines.Should().NotContain(" version Display version information.");
89 // Teardown
90 }
91 }
92}
Base type of all errors.
Definition Error.cs:110
It contains a sequence of CommandLine.Error.
override string ToString()
Returns the help screen as a System.String.
Definition HelpText.cs:830
static TypeInfo Create(Type current)