1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Diagnostics ;
4
4
using System . IO . Pipelines ;
@@ -262,13 +262,13 @@ public void HandlersShouldExtensionMethodClassWithMethods(
262
262
{
263
263
registries
264
264
. Where ( z => typeof ( ILanguageClientProxy ) . IsAssignableFrom ( z ) || typeof ( ILanguageServerRegistry ) . IsAssignableFrom ( z ) )
265
- . Should ( ) . HaveCountGreaterOrEqualTo (
265
+ . Should ( ) . HaveCountGreaterThanOrEqualTo (
266
266
1 ,
267
267
$ "{ descriptor . HandlerType . FullName } there should be methods for both handing the event and sending the event"
268
268
) ;
269
269
registries
270
270
. Where ( z => typeof ( ILanguageServerProxy ) . IsAssignableFrom ( z ) || typeof ( ILanguageClientRegistry ) . IsAssignableFrom ( z ) )
271
- . Should ( ) . HaveCountGreaterOrEqualTo (
271
+ . Should ( ) . HaveCountGreaterThanOrEqualTo (
272
272
1 ,
273
273
$ "{ descriptor . HandlerType . FullName } there should be methods for both handing the event and sending the event"
274
274
) ;
@@ -277,7 +277,7 @@ public void HandlersShouldExtensionMethodClassWithMethods(
277
277
{
278
278
registries
279
279
. Where ( z => typeof ( ILanguageServerProxy ) . IsAssignableFrom ( z ) || typeof ( ILanguageClientRegistry ) . IsAssignableFrom ( z ) )
280
- . Should ( ) . HaveCountGreaterOrEqualTo (
280
+ . Should ( ) . HaveCountGreaterThanOrEqualTo (
281
281
1 ,
282
282
$ "{ descriptor . HandlerType . FullName } there should be methods for both handing the event and sending the event"
283
283
) ;
@@ -289,7 +289,7 @@ public void HandlersShouldExtensionMethodClassWithMethods(
289
289
{
290
290
registries
291
291
. Where ( z => typeof ( ILanguageClientProxy ) . IsAssignableFrom ( z ) || typeof ( ILanguageServerRegistry ) . IsAssignableFrom ( z ) )
292
- . Should ( ) . HaveCountGreaterOrEqualTo (
292
+ . Should ( ) . HaveCountGreaterThanOrEqualTo (
293
293
1 ,
294
294
$ "{ descriptor . HandlerType . FullName } there should be methods for both handing the event and sending the event"
295
295
) ;
@@ -341,15 +341,15 @@ public void HandlersShouldHaveExpectedExtensionMethodsBasedOnDirection(
341
341
extensionClass . GetMethods ( BindingFlags . Static | BindingFlags . Public )
342
342
. Where ( z => z . Name == onMethodName )
343
343
. Where ( z => item . matcher ( z . GetParameters ( ) [ 0 ] ) )
344
- . Should ( ) . HaveCountGreaterOrEqualTo ( 1 , $ "{ descriptor . HandlerType . FullName } is missing a registry implementation for { item . type } ") ;
344
+ . Should ( ) . HaveCountGreaterThanOrEqualTo ( 1 , $ "{ descriptor . HandlerType . FullName } is missing a registry implementation for { item . type } ") ;
345
345
}
346
346
347
347
foreach ( var item in expectedRequestHandlers )
348
348
{
349
349
extensionClass . GetMethods ( BindingFlags . Static | BindingFlags . Public )
350
350
. Where ( z => z . Name == sendMethodName )
351
351
. Where ( z => item . matcher ( z . GetParameters ( ) [ 0 ] ) )
352
- . Should ( ) . HaveCountGreaterOrEqualTo ( 1 , $ "{ descriptor . HandlerType . FullName } is missing a request implementation for { item . type } ") ;
352
+ . Should ( ) . HaveCountGreaterThanOrEqualTo ( 1 , $ "{ descriptor . HandlerType . FullName } is missing a request implementation for { item . type } ") ;
353
353
}
354
354
}
355
355
@@ -386,7 +386,7 @@ Func<MethodInfo, bool> ForAnyParameter(Func<ParameterInfo, bool> m)
386
386
}
387
387
388
388
var containsCancellationToken = ForAnyParameter (
389
- info => info . ParameterType . GetGenericArguments ( ) . Reverse ( ) . Take ( 2 ) . Any ( x => x == typeof ( CancellationToken ) )
389
+ info => info . ParameterType . GetGenericArguments ( ) . AsEnumerable ( ) . Reverse ( ) . Take ( 2 ) . Any ( x => x == typeof ( CancellationToken ) )
390
390
) ;
391
391
var returnType = descriptor . HasResponseType ? typeof ( Task < > ) . MakeGenericType ( descriptor . ResponseType ! ) : typeof ( Task ) ;
392
392
var returns = ForAnyParameter ( info => info . ParameterType . GetGenericArguments ( ) . LastOrDefault ( ) == returnType ) ;
@@ -517,7 +517,7 @@ Func<MethodInfo, bool> ForAnyParameter(Func<ParameterInfo, bool> m)
517
517
{
518
518
var matcher = new MethodMatcher ( sendMethodRegistries , descriptor , extensionClass ) ;
519
519
Func < MethodInfo , bool > containsCancellationToken =
520
- info => info . GetParameters ( ) . Reverse ( ) . Take ( 2 ) . Any ( x => x . ParameterType == typeof ( CancellationToken ) ) ;
520
+ info => info . GetParameters ( ) . AsEnumerable ( ) . Reverse ( ) . Take ( 2 ) . Any ( x => x . ParameterType == typeof ( CancellationToken ) ) ;
521
521
var returnType = descriptor . HasResponseType ? typeof ( Task < > ) . MakeGenericType ( descriptor . ResponseType ! ) : typeof ( Task ) ;
522
522
Func < MethodInfo , bool > returns = info => info . ReturnType == returnType ;
523
523
Func < MethodInfo , bool > isAction = info => info . ReturnType . Name == "Void" ;
0 commit comments