@@ -9,16 +9,16 @@ public class ArgumentsIsolatedTests {
99 [ Fact ]
1010 public void Arguments_Positional_BeforeForwarding ( ) {
1111 // Positional 0 [Command]
12- Args . TryGetValue ( 0 , out var pos0 ) . Should ( ) . BeTrue ( ) ;
13- pos0 . Should ( ) . Be ( "command" ) ;
12+ Assert . True ( Args . TryGetValue ( 0 , out var pos0 ) ) ;
13+ Assert . Equal ( "command" , pos0 ) ;
1414
1515 // Positional 0 [positional]
16- Args . TryGetValue ( 1 , out var pos1 ) . Should ( ) . BeTrue ( ) ;
17- pos1 . Should ( ) . Be ( "positional" ) ;
16+ Assert . True ( Args . TryGetValue ( 1 , out var pos1 ) ) ;
17+ Assert . Equal ( "positional" , pos1 ) ;
1818
1919 // Positional 0 [positional2]
20- Args . TryGetValue ( 2 , out var pos2 ) . Should ( ) . BeTrue ( ) ;
21- pos2 . Should ( ) . Be ( "positional2" ) ;
20+ Assert . True ( Args . TryGetValue ( 2 , out var pos2 ) ) ;
21+ Assert . Equal ( "positional2" , pos2 ) ;
2222 }
2323
2424 [ Fact ]
@@ -29,24 +29,24 @@ public void Arguments_Positional_AfterForwarding() {
2929 // positional should be at 0, and positional2 at 1.
3030
3131 // Positional 0 [positional]
32- forwarded . TryGetValue ( 0 , out var pos0 ) . Should ( ) . BeTrue ( ) ;
33- pos0 . Should ( ) . Be ( "positional" ) ;
32+ Assert . True ( forwarded . TryGetValue ( 0 , out var pos0 ) ) ;
33+ Assert . Equal ( "positional" , pos0 ) ;
3434
3535 // Positional 1 [positional2]
36- forwarded . TryGetValue ( 1 , out var pos1 ) . Should ( ) . BeTrue ( ) ;
37- pos1 . Should ( ) . Be ( "positional2" ) ;
36+ Assert . True ( forwarded . TryGetValue ( 1 , out var pos1 ) ) ;
37+ Assert . Equal ( "positional2" , pos1 ) ;
3838 }
3939
4040 [ Fact ]
4141 public void Arguments_Named_BeforeForwarding ( ) {
4242 // named1 - Harold
4343 // named2 - Finch
4444
45- Args . TryGetValue ( "named1" , out var firstName ) . Should ( ) . BeTrue ( ) ;
46- firstName . Should ( ) . Be ( "Harold" ) ;
45+ Assert . True ( Args . TryGetValue ( "named1" , out var firstName ) ) ;
46+ Assert . Equal ( "Harold" , firstName ) ;
4747
48- Args . TryGetValue ( "named2" , out var lastName ) . Should ( ) . BeTrue ( ) ;
49- lastName . Should ( ) . Be ( "Finch" ) ;
48+ Assert . True ( Args . TryGetValue ( "named2" , out var lastName ) ) ;
49+ Assert . Equal ( "Finch" , lastName ) ;
5050 }
5151
5252 [ Fact ]
@@ -56,214 +56,214 @@ public void Arguments_Named_AfterForwarding() {
5656 // named1 - Harold
5757 // named2 - Finch
5858
59- forwarded . TryGetValue ( "named1" , out var firstName ) . Should ( ) . BeTrue ( ) ;
60- firstName . Should ( ) . Be ( "Harold" ) ;
59+ Assert . True ( forwarded . TryGetValue ( "named1" , out var firstName ) ) ;
60+ Assert . Equal ( "Harold" , firstName ) ;
6161
62- forwarded . TryGetValue ( "named2" , out var lastName ) . Should ( ) . BeTrue ( ) ;
63- lastName . Should ( ) . Be ( "Finch" ) ;
62+ Assert . True ( forwarded . TryGetValue ( "named2" , out var lastName ) ) ;
63+ Assert . Equal ( "Finch" , lastName ) ;
6464 }
6565
6666 [ Fact ]
6767 public void Arguments_Flag_BeforeForwarding ( ) {
68- Args . HasFlag ( "flag" ) . Should ( ) . BeTrue ( ) ;
68+ Assert . True ( Args . HasFlag ( "flag" ) ) ;
6969 }
7070
7171 [ Fact ]
7272 public void Arguments_Flag_AfterForwarding ( ) {
7373 var forwarded = Args . ForwardPositionalArguments ( ) ;
74- forwarded . HasFlag ( "flag" ) . Should ( ) . BeTrue ( ) ;
74+ Assert . True ( forwarded . HasFlag ( "flag" ) ) ;
7575 }
7676
7777 [ Fact ]
7878 public void Arguments_Contains_Key ( ) {
79- Args . Contains ( "named1" ) . Should ( ) . BeTrue ( ) ;
79+ Assert . True ( Args . Contains ( "named1" ) ) ;
8080 }
8181
8282 [ Fact ]
8383 public void Arguments_Contains_Position ( ) {
84- Args . Contains ( 0 ) . Should ( ) . BeTrue ( ) ;
84+ Assert . True ( Args . Contains ( 0 ) ) ;
8585 }
8686
8787 [ Fact ]
8888 public void Arguments_Named_Array_String ( ) {
89- Args . TryGetValues ( "words" , "|" , out var words ) . Should ( ) . BeTrue ( ) ;
90- words . Should ( ) . BeEquivalentTo ( [ "word1" , "word2" ] ) ;
89+ Assert . True ( Args . TryGetValues ( "words" , "|" , out var words ) ) ;
90+ Assert . Equal ( [ "word1" , "word2" ] , words ) ;
9191 }
9292
9393 [ Fact ]
9494 public void Arguments_Named_MultipleKeys_Array_String ( ) {
9595 var args = Parser . ParseArguments ( "command --words word1|word2" ) ! ;
96- args . TryGetValues ( [ "words" , "w" ] , "|" , out var words ) . Should ( ) . BeTrue ( ) ;
97- words . Should ( ) . BeEquivalentTo ( [ "word1" , "word2" ] ) ;
96+ Assert . True ( args . TryGetValues ( [ "words" , "w" ] , "|" , out var words ) ) ;
97+ Assert . Equal ( [ "word1" , "word2" ] , words ) ;
9898 args = Parser . ParseArguments ( "command --w word1|word2" ) ! ;
99- args . TryGetValues ( [ "words" , "w" ] , "|" , out var w ) . Should ( ) . BeTrue ( ) ;
100- w . Should ( ) . BeEquivalentTo ( [ "word1" , "word2" ] ) ;
99+ Assert . True ( args . TryGetValues ( [ "words" , "w" ] , "|" , out var w ) ) ;
100+ Assert . Equal ( [ "word1" , "word2" ] , w ) ;
101101 }
102102
103103 [ Fact ]
104104 public void Arguments_Named_MultipleKeys_Array_Int ( ) {
105105 var args = Parser . ParseArguments ( "command --numbers 1|2" ) ! ;
106- args . TryGetValues < int > ( [ "numbers" , "n" ] , "|" , out var numbers ) . Should ( ) . BeTrue ( ) ;
107- numbers . Should ( ) . BeEquivalentTo ( [ 1 , 2 ] ) ;
106+ Assert . True ( args . TryGetValues < int > ( [ "numbers" , "n" ] , "|" , out var numbers ) ) ;
107+ Assert . Equal ( [ 1 , 2 ] , numbers ) ;
108108 args = Parser . ParseArguments ( "command -n 1|2" ) ! ;
109- args . TryGetValues < int > ( [ "numbers" , "n" ] , "|" , out var n ) . Should ( ) . BeTrue ( ) ;
110- n . Should ( ) . BeEquivalentTo ( [ 1 , 2 ] ) ;
109+ Assert . True ( args . TryGetValues < int > ( [ "numbers" , "n" ] , "|" , out var n ) ) ;
110+ Assert . Equal ( [ 1 , 2 ] , n ) ;
111111 }
112112
113113 [ Fact ]
114114 public void Arguments_Positional_Array_String ( ) {
115115 var args = Parser . ParseArguments ( "command q1|q2" ) ! ;
116- args . TryGetValues ( 1 , "|" , out var words ) . Should ( ) . BeTrue ( ) ;
117- words . Should ( ) . BeEquivalentTo ( [ "q1" , "q2" ] ) ;
116+ Assert . True ( args . TryGetValues ( 1 , "|" , out var words ) ) ;
117+ Assert . Equal ( [ "q1" , "q2" ] , words ) ;
118118 }
119119
120120 [ Fact ]
121121 public void Arguments_Named_Array_Int ( ) {
122- Args . TryGetValues < int > ( "numbers" , "|" , out var numbers ) . Should ( ) . BeTrue ( ) ;
123- numbers . Should ( ) . BeEquivalentTo ( [ 1 , 2 ] ) ;
122+ Assert . True ( Args . TryGetValues < int > ( "numbers" , "|" , out var numbers ) ) ;
123+ Assert . Equal ( [ 1 , 2 ] , numbers ) ;
124124 }
125125
126126 [ Fact ]
127127 public void Arguments_Positional_Array_Int ( ) {
128128 var args = Parser . ParseArguments ( "command 1|2" ) ! ;
129- args . TryGetValues < int > ( 1 , "|" , out var numbers ) . Should ( ) . BeTrue ( ) ;
130- numbers . Should ( ) . BeEquivalentTo ( [ 1 , 2 ] ) ;
129+ Assert . True ( args . TryGetValues < int > ( 1 , "|" , out var numbers ) ) ;
130+ Assert . Equal ( [ 1 , 2 ] , numbers ) ;
131131 }
132132
133133 [ Fact ]
134134 public void Arguments_TryGetValue_Named_Int ( ) {
135135 var args = Parser . ParseArguments ( "command -x 5 -y Hello" ) ! ;
136- args . TryGetValue ( "x" , 0 , out int x ) . Should ( ) . BeTrue ( ) ;
137- x . Should ( ) . Be ( 5 ) ;
138- args . TryGetValue ( "y" , 0 , out int y ) . Should ( ) . BeFalse ( ) ;
139- y . Should ( ) . Be ( 0 ) ;
136+ Assert . True ( args . TryGetValue ( "x" , 0 , out int x ) ) ;
137+ Assert . Equal ( 5 , x ) ;
138+ Assert . False ( args . TryGetValue ( "y" , 0 , out int y ) ) ;
139+ Assert . Equal ( 0 , y ) ;
140140 }
141141
142142 [ Fact ]
143143 public void Arguments_TryGetValue_Named_Double ( ) {
144144 var args = Parser . ParseArguments ( "command -x 5 -y Hello" ) ! ;
145- args . TryGetValue ( "x" , 0 , out double x ) . Should ( ) . BeTrue ( ) ;
146- x . Should ( ) . Be ( 5 ) ;
147- args . TryGetValue ( "y" , 0 , out double y ) . Should ( ) . BeFalse ( ) ;
148- y . Should ( ) . Be ( 0 ) ;
145+ Assert . True ( args . TryGetValue ( "x" , 0 , out double x ) ) ;
146+ Assert . Equal ( 5 , x ) ;
147+ Assert . False ( args . TryGetValue ( "y" , 0 , out double y ) ) ;
148+ Assert . Equal ( 0 , y ) ;
149149 }
150150
151151 [ Fact ]
152152 public void Arguments_GetValue_Named_Int ( ) {
153153 var args = Parser . ParseArguments ( "command -x 5 -y Hello" ) ! ;
154- args . GetValue ( "x" , 0 ) . Should ( ) . Be ( 5 ) ;
155- args . GetValue ( "y" , 0 ) . Should ( ) . Be ( 0 ) ;
154+ Assert . Equal ( 5 , args . GetValue ( "x" , 0 ) ) ;
155+ Assert . Equal ( 0 , args . GetValue ( "y" , 0 ) ) ;
156156 }
157157
158158 [ Fact ]
159159 public void Arguments_GetValue_Named_MultipleKeys_Int ( ) {
160160 var args = Parser . ParseArguments ( "command -x 5 -y Hello" ) ! ;
161- args . GetValue ( [ "x" , "one" ] , 0 ) . Should ( ) . Be ( 5 ) ;
161+ Assert . Equal ( 5 , args . GetValue ( [ "x" , "one" ] , 0 ) ) ;
162162 args = Parser . ParseArguments ( "command --one 5 -y Hello" ) ! ;
163- args . GetValue ( [ "x" , "one" ] , 0 ) . Should ( ) . Be ( 5 ) ;
163+ Assert . Equal ( 5 , args . GetValue ( [ "x" , "one" ] , 0 ) ) ;
164164 }
165165
166166 [ Fact ]
167167 public void Arguments_TryGetValue_Positional_Int ( ) {
168168 var args = Parser . ParseArguments ( "command 5 Hello" ) ! ;
169- args . TryGetValue ( 1 , 0 , out double x ) . Should ( ) . BeTrue ( ) ;
170- x . Should ( ) . Be ( 5 ) ;
171- args . TryGetValue ( 2 , 0 , out double y ) . Should ( ) . BeFalse ( ) ;
172- y . Should ( ) . Be ( 0 ) ;
169+ Assert . True ( args . TryGetValue ( 1 , 0 , out double x ) ) ;
170+ Assert . Equal ( 5 , x ) ;
171+ Assert . False ( args . TryGetValue ( 2 , 0 , out double y ) ) ;
172+ Assert . Equal ( 0 , y ) ;
173173 }
174174
175175 [ Fact ]
176176 public void Arguments_GetValue_Positional_Int ( ) {
177177 var args = Parser . ParseArguments ( "command 5 Hello" ) ! ;
178- args . GetValue ( 1 , 0 ) . Should ( ) . Be ( 5 ) ;
179- args . GetValue ( 2 , 0 ) . Should ( ) . Be ( 0 ) ;
178+ Assert . Equal ( 5 , args . GetValue ( 1 , 0 ) ) ;
179+ Assert . Equal ( 0 , args . GetValue ( 2 , 0 ) ) ;
180180 }
181181
182182 [ Fact ]
183183 public void Arguments_TryGetEnum_Positional ( ) {
184184 var args = Parser . ParseArguments ( "command Blue" ) ! ;
185- args . TryGetEnum ( 1 , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
186- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
185+ Assert . True ( args . TryGetEnum ( 1 , out ConsoleColor color ) ) ;
186+ Assert . Equal ( ConsoleColor . Blue , color ) ;
187187 }
188188
189189 [ Fact ]
190190 public void Arguments_TryGetEnum_Positional_IgnoreCase ( ) {
191191 var args = Parser . ParseArguments ( "command bLue" ) ! ;
192- args . TryGetEnum ( 1 , true , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
193- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
192+ Assert . True ( args . TryGetEnum ( 1 , true , out ConsoleColor color ) ) ;
193+ Assert . Equal ( ConsoleColor . Blue , color ) ;
194194 }
195195
196196 [ Fact ]
197197 public void Arguments_TryGetEnum_Named ( ) {
198198 var args = Parser . ParseArguments ( "command --color Blue" ) ! ;
199- args . TryGetEnum ( "color" , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
200- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
199+ Assert . True ( args . TryGetEnum ( "color" , out ConsoleColor color ) ) ;
200+ Assert . Equal ( ConsoleColor . Blue , color ) ;
201201 }
202202
203203 [ Fact ]
204204 public void Arguments_TryGetEnum_Named_IgnoreCase ( ) {
205205 var args = Parser . ParseArguments ( "command --color bLue" ) ! ;
206- args . TryGetEnum ( "color" , true , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
207- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
206+ Assert . True ( args . TryGetEnum ( "color" , true , out ConsoleColor color ) ) ;
207+ Assert . Equal ( ConsoleColor . Blue , color ) ;
208208 }
209209
210210 [ Fact ]
211211 public void Arguments_TryGetEnum_Named_MultipleKeys ( ) {
212212 var args = Parser . ParseArguments ( "command --color Blue" ) ! ;
213- args . TryGetEnum ( [ "color" , "c" ] , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
214- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
213+ Assert . True ( args . TryGetEnum ( [ "color" , "c" ] , out ConsoleColor color ) ) ;
214+ Assert . Equal ( ConsoleColor . Blue , color ) ;
215215 args = Parser . ParseArguments ( "command -c Blue" ) ! ;
216- args . TryGetEnum ( [ "color" , "c" ] , out ConsoleColor c ) . Should ( ) . BeTrue ( ) ;
217- c . Should ( ) . Be ( ConsoleColor . Blue ) ;
216+ Assert . True ( args . TryGetEnum ( [ "color" , "c" ] , out ConsoleColor c ) ) ;
217+ Assert . Equal ( ConsoleColor . Blue , c ) ;
218218 }
219219
220220 [ Fact ]
221221 public void Arguments_TryGetEnum_Named_MultipleKeys_IgnoreCase ( ) {
222222 var args = Parser . ParseArguments ( "command --color bLue" ) ! ;
223- args . TryGetEnum ( [ "color" , "c" ] , true , out ConsoleColor color ) . Should ( ) . BeTrue ( ) ;
224- color . Should ( ) . Be ( ConsoleColor . Blue ) ;
223+ Assert . True ( args . TryGetEnum ( [ "color" , "c" ] , true , out ConsoleColor color ) ) ;
224+ Assert . Equal ( ConsoleColor . Blue , color ) ;
225225 args = Parser . ParseArguments ( "command -c bLue" ) ! ;
226- args . TryGetEnum ( [ "color" , "c" ] , true , out ConsoleColor c ) . Should ( ) . BeTrue ( ) ;
227- c . Should ( ) . Be ( ConsoleColor . Blue ) ;
226+ Assert . True ( args . TryGetEnum ( [ "color" , "c" ] , true , out ConsoleColor c ) ) ;
227+ Assert . Equal ( ConsoleColor . Blue , c ) ;
228228 }
229229
230230 [ Fact ]
231231 public void Arguments_GetEnum_Positional ( ) {
232232 var args = Parser . ParseArguments ( "command Blue" ) ! ;
233- args . GetEnum ( 1 , ConsoleColor . Black ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
233+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( 1 , ConsoleColor . Black ) ) ;
234234 }
235235
236236 [ Fact ]
237237 public void Arguments_GetEnum_Positional_IgnoreCase ( ) {
238238 var args = Parser . ParseArguments ( "command bLue" ) ! ;
239- args . GetEnum ( 1 , ConsoleColor . Black , true ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
239+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( 1 , ConsoleColor . Black , true ) ) ;
240240 }
241241
242242 [ Fact ]
243243 public void Arguments_GetEnum_Named ( ) {
244244 var args = Parser . ParseArguments ( "command --color Blue" ) ! ;
245- args . GetEnum ( "color" , ConsoleColor . Black ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
245+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( "color" , ConsoleColor . Black ) ) ;
246246 }
247247
248248 [ Fact ]
249249 public void Arguments_GetEnum_Named_IgnoreCase ( ) {
250250 var args = Parser . ParseArguments ( "command --color bLue" ) ! ;
251- args . GetEnum ( "color" , ConsoleColor . Black , true ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
251+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( "color" , ConsoleColor . Black , true ) ) ;
252252 }
253253
254254 [ Fact ]
255255 public void Arguments_GetEnum_Named_MultipleKeys ( ) {
256256 var args = Parser . ParseArguments ( "command --color Blue" ) ! ;
257- args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
257+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black ) ) ;
258258 args = Parser . ParseArguments ( "command -c Blue" ) ! ;
259- args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
259+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black ) ) ;
260260 }
261261
262262 [ Fact ]
263263 public void Arguments_GetEnum_Named_MultipleKeys_IgnoreCase ( ) {
264264 var args = Parser . ParseArguments ( "command --color bLue" ) ! ;
265- args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black , true ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
265+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black , true ) ) ;
266266 args = Parser . ParseArguments ( "command -c bLue" ) ! ;
267- args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black , true ) . Should ( ) . Be ( ConsoleColor . Blue ) ;
267+ Assert . Equal ( ConsoleColor . Blue , args . GetEnum ( [ "color" , "c" ] , ConsoleColor . Black , true ) ) ;
268268 }
269269}
0 commit comments