@@ -18,19 +18,6 @@ protected class RootProperties
1818 public static int [ ] IntArray { get ; set ; }
1919 }
2020
21- private readonly BindingTargetBuilder _builder ;
22-
23- public StaticLevelTests ( )
24- {
25- _builder = TestServiceProvider . Instance . GetRequiredService < BindingTargetBuilder > ( ) ;
26-
27- _builder . Prefixes ( "-" , "--" , "/" )
28- . Quotes ( '\' ' , '"' )
29- . HelpKeys ( "h" , "?" )
30- . Description ( "a test program for exercising J4JCommandLine" )
31- . ProgramName ( $ "{ this . GetType ( ) } ") ;
32- }
33-
3421 [ Theory ]
3522 [ InlineData ( "z" , "32" , true , MappingResults . MissingRequired , - 1 ) ]
3623 [ InlineData ( "x" , "32" , true , MappingResults . Success , 32 ) ]
@@ -42,8 +29,7 @@ public void Simple_property_single(
4229 MappingResults result ,
4330 int desiredValue )
4431 {
45- _builder . Build < RootProperties > ( null , out var target ) ;
46-
32+ var target = ServiceProvider . GetBindingTarget < RootProperties > ( true ) ;
4733 target . Should ( ) . NotBeNull ( ) ;
4834
4935 var option = target ! . Bind ( x => RootProperties . IntProperty , "x" ) ;
@@ -75,8 +61,7 @@ public void Simple_property_array(
7561 {
7662 var desired = desiredValues == null ? new List < int > ( ) : new List < int > ( desiredValues ) ;
7763
78- _builder . Build < RootProperties > ( null , out var target ) ;
79-
64+ var target = ServiceProvider . GetBindingTarget < RootProperties > ( true ) ;
8065 target . Should ( ) . NotBeNull ( ) ;
8166
8267 var option = target ! . Bind ( x => RootProperties . IntArray , "x" ) ;
@@ -111,8 +96,7 @@ public void Simple_property_list(
11196 {
11297 var desired = desiredValues == null ? new List < int > ( ) : new List < int > ( desiredValues ) ;
11398
114- _builder . Build < RootProperties > ( null , out var target ) ;
115-
99+ var target = ServiceProvider . GetBindingTarget < RootProperties > ( true ) ;
116100 target . Should ( ) . NotBeNull ( ) ;
117101
118102 var option = target ! . Bind ( x => RootProperties . IntList , "x" ) ;
@@ -144,8 +128,7 @@ public void Num_parameters_list(
144128 int maxArgs ,
145129 MappingResults result )
146130 {
147- _builder . Build < RootProperties > ( null , out var target ) ;
148-
131+ var target = ServiceProvider . GetBindingTarget < RootProperties > ( true ) ;
149132 target . Should ( ) . NotBeNull ( ) ;
150133
151134 var option = target ! . Bind ( x => RootProperties . IntList , "x" ) ;
@@ -184,8 +167,7 @@ public void Num_parameters_array(
184167 int maxArgs ,
185168 MappingResults result )
186169 {
187- _builder . Build < RootProperties > ( null , out var target ) ;
188-
170+ var target = ServiceProvider . GetBindingTarget < RootProperties > ( true ) ;
189171 target . Should ( ) . NotBeNull ( ) ;
190172
191173 var option = target ! . Bind ( x => RootProperties . IntArray , "x" ) ;
0 commit comments