@@ -23,7 +23,7 @@ namespace Lsp.Tests.Matchers
2323 public class ResolveCommandMatcherTests : AutoTestBase
2424 {
2525 private readonly Guid _trueId = Guid . NewGuid ( ) ;
26- private readonly Guid _falseId = Guid . NewGuid ( ) ;
26+ private readonly Guid _falseId = Guid . Empty ;
2727
2828 public ResolveCommandMatcherTests ( ITestOutputHelper testOutputHelper ) : base ( testOutputHelper )
2929 {
@@ -247,7 +247,7 @@ public async Task Should_Update_CompletionItems_With_HandlerType()
247247 0 ,
248248 TextDocumentNames . Completion ,
249249 "Key" ,
250- ( resolveHandler as IJsonRpcHandler ) ! ,
250+ ( resolveHandler as IJsonRpcHandler ) ! ,
251251 resolveHandler . GetType ( ) ,
252252 typeof ( CompletionParams ) ,
253253 null ,
@@ -298,7 +298,7 @@ public async Task Should_Update_CodeLensContainer_With_HandlerType()
298298 0 ,
299299 TextDocumentNames . CodeLens ,
300300 "Key" ,
301- ( resolveHandler as IJsonRpcHandler ) ! ,
301+ ( resolveHandler as IJsonRpcHandler ) ! ,
302302 resolveHandler . GetType ( ) ,
303303 typeof ( CodeLensParams ) ,
304304 null ,
@@ -344,12 +344,12 @@ public async Task Should_Update_CodeLens_Removing_HandlerType()
344344 typeof ( ICanBeIdentifiedHandler )
345345 } , new object [ 0 ]
346346 ) ;
347- ( resolveHandler as ICanBeIdentifiedHandler ) ? . Id . Returns ( _trueId ) ;
347+ ( resolveHandler as ICanBeIdentifiedHandler ) ? . Id . Returns ( _falseId ) ;
348348 var descriptor = new LspHandlerDescriptor (
349349 0 ,
350350 TextDocumentNames . CodeLensResolve ,
351351 "Key" ,
352- ( resolveHandler as IJsonRpcHandler ) ! ,
352+ ( resolveHandler as IJsonRpcHandler ) ! ,
353353 resolveHandler . GetType ( ) ,
354354 typeof ( CodeLens ) ,
355355 null ,
@@ -368,15 +368,15 @@ public async Task Should_Update_CodeLens_Removing_HandlerType()
368368 var item = new CodeLens {
369369 Data = JObject . FromObject ( new { hello = "world" } )
370370 } ;
371- item . Data [ Constants . PrivateHandlerId ] = Guid . Empty ;
372371
373372 // When
374373 var response = await handlerMatcher . Handle ( item , CancellationToken . None , ( ) => Task . FromResult ( item ) ) ;
375374
376375 // Then
377376 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" ) ;
380380 }
381381 }
382382}
0 commit comments