@@ -23,7 +23,7 @@ namespace Lsp.Tests.Matchers
23
23
public class ResolveCommandMatcherTests : AutoTestBase
24
24
{
25
25
private readonly Guid _trueId = Guid . NewGuid ( ) ;
26
- private readonly Guid _falseId = Guid . NewGuid ( ) ;
26
+ private readonly Guid _falseId = Guid . Empty ;
27
27
28
28
public ResolveCommandMatcherTests ( ITestOutputHelper testOutputHelper ) : base ( testOutputHelper )
29
29
{
@@ -247,7 +247,7 @@ public async Task Should_Update_CompletionItems_With_HandlerType()
247
247
0 ,
248
248
TextDocumentNames . Completion ,
249
249
"Key" ,
250
- ( resolveHandler as IJsonRpcHandler ) ! ,
250
+ ( resolveHandler as IJsonRpcHandler ) ! ,
251
251
resolveHandler . GetType ( ) ,
252
252
typeof ( CompletionParams ) ,
253
253
null ,
@@ -298,7 +298,7 @@ public async Task Should_Update_CodeLensContainer_With_HandlerType()
298
298
0 ,
299
299
TextDocumentNames . CodeLens ,
300
300
"Key" ,
301
- ( resolveHandler as IJsonRpcHandler ) ! ,
301
+ ( resolveHandler as IJsonRpcHandler ) ! ,
302
302
resolveHandler . GetType ( ) ,
303
303
typeof ( CodeLensParams ) ,
304
304
null ,
@@ -344,12 +344,12 @@ public async Task Should_Update_CodeLens_Removing_HandlerType()
344
344
typeof ( ICanBeIdentifiedHandler )
345
345
} , new object [ 0 ]
346
346
) ;
347
- ( resolveHandler as ICanBeIdentifiedHandler ) ? . Id . Returns ( _trueId ) ;
347
+ ( resolveHandler as ICanBeIdentifiedHandler ) ? . Id . Returns ( _falseId ) ;
348
348
var descriptor = new LspHandlerDescriptor (
349
349
0 ,
350
350
TextDocumentNames . CodeLensResolve ,
351
351
"Key" ,
352
- ( resolveHandler as IJsonRpcHandler ) ! ,
352
+ ( resolveHandler as IJsonRpcHandler ) ! ,
353
353
resolveHandler . GetType ( ) ,
354
354
typeof ( CodeLens ) ,
355
355
null ,
@@ -368,15 +368,15 @@ public async Task Should_Update_CodeLens_Removing_HandlerType()
368
368
var item = new CodeLens {
369
369
Data = JObject . FromObject ( new { hello = "world" } )
370
370
} ;
371
- item . Data [ Constants . PrivateHandlerId ] = Guid . Empty ;
372
371
373
372
// When
374
373
var response = await handlerMatcher . Handle ( item , CancellationToken . None , ( ) => Task . FromResult ( item ) ) ;
375
374
376
375
// Then
377
376
response . Should ( ) . BeEquivalentTo ( item , x => x . UsingStructuralRecordEquality ( ) ) ;
378
- item . Data ? [ Constants . PrivateHandlerId ] . Value < Guid > ( ) . Should ( ) . BeEmpty ( ) ;
379
- item . Data ? [ "hello" ] . Value < string > ( ) . Should ( ) . Be ( "world" ) ;
377
+ var data = item . Data . Should ( ) . BeOfType < JObject > ( ) . Subject ;
378
+ data . Should ( ) . NotContainKey ( Constants . PrivateHandlerId ) ;
379
+ data [ "hello" ] . Value < string > ( ) . Should ( ) . Be ( "world" ) ;
380
380
}
381
381
}
382
382
}
0 commit comments