7 instantiations of MockRequest
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (7)
RequestExecutionQueueTests.cs (7)
55await Assert.ThrowsAsync<NotImplementedException>(() => requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), ThrowingHandler.Name, lspServices, CancellationToken.None));
76var _ = requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), CancellingHandler.Name, lspServices, cancellingRequestCancellationToken);
77var _1 = requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), CompletingHandler.Name, lspServices, completingRequestCancellationToken);
81await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), MutatingHandler.Name, lspServices, CancellationToken.None);
104var response = (MockResponse?)await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), TestMethodHandler.Name, lspServices, CancellationToken.None);
124var response = await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), TestNotificationHandler.Name, lspServices, CancellationToken.None);
142var request = JToken.FromObject(new MockRequest(1));
24 references to MockRequest
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (24)
Mocks\TestMethodHandlers.cs (24)
16internal class TestMethodHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
22public static TypeRef RequestType = TypeRef.Of<MockRequest>();
26public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
46internal class TestNotificationHandler : INotificationHandler<MockRequest, TestRequestContext>
52public static TypeRef RequestTypeRef = TypeRef.Of<MockRequest>();
55public Task HandleNotificationAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
83internal class MutatingHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
88public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<MockResponse>(), LanguageServerConstants.DefaultLanguageName);
96public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
103internal class CompletingHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
107public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<MockResponse>(), LanguageServerConstants.DefaultLanguageName);
111public async Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
125internal class CancellingHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
129public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<MockResponse>(), LanguageServerConstants.DefaultLanguageName);
133public async Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
144internal class ThrowingHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
148public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<MockResponse>(), LanguageServerConstants.DefaultLanguageName);
152public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
159internal class TestDefaultLanguageHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
165public static TypeRef RequestType = TypeRef.Of<MockRequest>();
169public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
174internal class TestXamlLanguageHandler : IRequestHandler<MockRequest, MockResponse, TestRequestContext>
181public static TypeRef RequestType = TypeRef.Of<MockRequest>();
185public Task<MockResponse> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)