@@ -48,10 +48,10 @@ naval_fate.exe mine (set|remove) <x> <y> [--moored | --drifting]
4848 [ Test ]
4949 public void Generate_with_usage_in_external_file ( )
5050 {
51- AssertMatchesSnapshot ( new [ ]
52- {
51+ AssertMatchesSnapshot (
52+ [
5353 ( "Program.docopt.txt" , SourceText . From ( NavalFateUsage ) )
54- } ) ;
54+ ] ) ;
5555 }
5656
5757 [ Test ]
@@ -68,38 +68,38 @@ public void Generate_with_empty_root_namespace()
6868 [ Test ]
6969 public void Generate_with_inline_usage ( )
7070 {
71- AssertMatchesSnapshot ( new [ ]
72- {
71+ AssertMatchesSnapshot (
72+ [
7373 ( "Program.cs" , SourceText . From ( $@ "
7474 [DocoptNet.DocoptArguments]
7575 partial class Arguments
7676 {{
7777 public const string Help = @""{ NavalFateUsage } "";
7878 }}" ) )
79- } ) ;
79+ ] ) ;
8080 }
8181
8282 [ Test ]
8383 public void Generate_with_inline_usage_with_custom_const_name ( )
8484 {
85- AssertMatchesSnapshot ( new [ ]
86- {
85+ AssertMatchesSnapshot (
86+ [
8787 ( "Program.cs" , SourceText . From ( $@ "
8888 [DocoptNet.DocoptArguments(HelpConstName = nameof(HelpText))]
8989 partial class Arguments
9090 {{
9191 public const string HelpText = @""{ NavalFateUsage } "";
9292 }}" ) )
93- } ) ;
93+ ] ) ;
9494 }
9595
9696 [ Test ]
9797 public void Generate_with_multiple_inline_usages ( )
9898 {
9999 const string help = "Usage: my_program (run [--fast] | jump [--high])" ;
100100
101- AssertMatchesSnapshot ( new [ ]
102- {
101+ AssertMatchesSnapshot (
102+ [
103103 ( "Program.cs" , SourceText . From ( @"
104104 using System;
105105 using DocoptNet;
@@ -133,14 +133,14 @@ partial class Arguments8 { public const string Help = @""" + help + @"""; }
133133
134134 [Arguments]
135135 partial class Arguments8 { }" ) )
136- } ) ;
136+ ] ) ;
137137 }
138138
139139 [ Test ]
140140 public void Generate_with_inline_usage_missing_help_const ( )
141141 {
142- AssertMatchesSnapshot ( new [ ]
143- {
142+ AssertMatchesSnapshot (
143+ [
144144 ( "Program.cs" , SourceText . From ( @"
145145 [DocoptNet.DocoptArguments]
146146 partial class Arguments1 { }
@@ -150,14 +150,14 @@ partial class Arguments2 { public const string Help = @""Usage: program""; }
150150
151151 [DocoptNet.DocoptArguments]
152152 partial class Arguments3 { public string Help => @""Usage: program""; }" ) )
153- } ) ;
153+ ] ) ;
154154 }
155155
156156 [ Test ]
157157 public void Generate_with_nested_namespace ( )
158158 {
159- AssertMatchesSnapshot ( new [ ]
160- {
159+ AssertMatchesSnapshot (
160+ [
161161 ( "Program.cs" , SourceText . From ( @"
162162 namespace Outer
163163 {
@@ -167,14 +167,14 @@ namespace Inner
167167 partial class Arguments { const string Help = @""Usage: program""; }
168168 }
169169 }" ) )
170- } ) ;
170+ ] ) ;
171171 }
172172
173173 [ Test ]
174174 public void Generate_with_classes_from_different_namespaces_share_the_same_name ( )
175175 {
176- AssertMatchesSnapshot ( new [ ]
177- {
176+ AssertMatchesSnapshot (
177+ [
178178 ( "Program.cs" , SourceText . From ( @"
179179 [DocoptNet.DocoptArguments]
180180 sealed partial class ProgramArguments
@@ -199,14 +199,14 @@ sealed partial class ProgramArguments
199199 const string Help = ""Usage: program"";
200200 }
201201 }" ) )
202- } ) ;
202+ ] ) ;
203203 }
204204
205205 [ Test ]
206206 public void Generate_with_nested_args_class ( )
207207 {
208- AssertMatchesSnapshot ( new [ ]
209- {
208+ AssertMatchesSnapshot (
209+ [
210210 ( "Program.cs" , SourceText . From ( @"
211211 static partial class Program
212212 {
@@ -237,14 +237,14 @@ sealed partial class Arguments
237237 }
238238 }
239239 }" ) )
240- } ) ;
240+ ] ) ;
241241 }
242242
243243 [ Test ]
244244 public void Generate_with_classes_in_separate_files ( )
245245 {
246- AssertMatchesSnapshot ( new [ ]
247- {
246+ AssertMatchesSnapshot (
247+ [
248248 ( "File1.cs" , SourceText . From ( @"
249249 namespace Namespace1
250250 {
@@ -263,7 +263,7 @@ sealed partial class ProgramArguments
263263 const string Help = ""Usage: program"";
264264 }
265265 }" ) ) ,
266- } ) ;
266+ ] ) ;
267267 }
268268
269269 void AssertMatchesSnapshot ( ( string Path , SourceText Text ) [ ] sources ,
@@ -365,7 +365,7 @@ orderby af
365365
366366 var expectedFiles = Directory . Exists ( expectedSourcesPath )
367367 ? EnumerateFiles ( expectedSourcesPath )
368- : Enumerable . Empty < string > ( ) ;
368+ : [ ] ;
369369
370370 var results =
371371 expectedFiles . FullJoin ( actualFiles ,
@@ -539,7 +539,7 @@ public T Run<T>(DocoptOptions options, Func<IDictionary, T> selector, params str
539539 var method = _type . GetMethod ( parserFactoryMethodName , BindingFlags . Public | BindingFlags . Static ) ;
540540 if ( method == null )
541541 throw new MissingMethodException ( _type . Name , parserFactoryMethodName ) ;
542- var parser = ( IBaselineParser < object > ) method . Invoke ( null , Array . Empty < object > ( ) ) ! ;
542+ var parser = ( IBaselineParser < object > ) method . Invoke ( null , [ ] ) ! ;
543543 parser = parser . WithOptions ( parser . Options . WithOptionsFirst ( options . OptionsFirst ) ) ;
544544 var result = options . Help
545545 ? ( IParser < object > . IResult ) parser . EnableHelp ( ) . Parse ( argv )
@@ -611,7 +611,7 @@ internal static (CSharpGeneratorDriver, CSharpCompilation)
611611 additionalTexts . Select ( at => KeyValuePair . Create ( at , DocoptSourceItemTypeConfigOption ) )
612612 . ToImmutableDictionary ( ) ) ;
613613
614- var driver = CSharpGeneratorDriver . Create ( new [ ] { generator } ,
614+ var driver = CSharpGeneratorDriver . Create ( [ generator ] ,
615615 additionalTexts ,
616616 optionsProvider : optionsProvider ) ;
617617
0 commit comments