1 instantiation of TestMethodHandler
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (1)
Mocks\TestMethodHandlers.cs (1)
19
public static readonly IMethodHandler Instance = new
TestMethodHandler
();
19 references to TestMethodHandler
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (19)
HandlerProviderTests.cs (10)
19
var methodHandler = handlerProvider.GetMethodHandler(
TestMethodHandler
.Name,
TestMethodHandler
.RequestType,
TestMethodHandler
.ResponseType, LanguageServerConstants.DefaultLanguageName);
20
Assert.Same(
TestMethodHandler
.Instance, methodHandler);
55
Assert.Throws<InvalidOperationException>(() => handlerProvider.GetMethodHandler("UndefinedMethod",
TestMethodHandler
.RequestType,
TestMethodHandler
.ResponseType, LanguageServerConstants.DefaultLanguageName));
63
Assert.Throws<InvalidOperationException>(() => handlerProvider.GetMethodHandler(
TestMethodHandler
.Name,
TestMethodHandler
.RequestType, responseTypeRef: TypeRef.Of<long>(), LanguageServerConstants.DefaultLanguageName));
74
r => Assert.Equal(
TestMethodHandler
.Name, r.MethodName),
102
(typeof(IMethodHandler),
TestMethodHandler
.Instance),
RequestExecutionQueueTests.cs (9)
89
var requestExecutionQueue = GetRequestExecutionQueue(false, (
TestMethodHandler
.Metadata,
TestMethodHandler
.Instance));
101
var requestExecutionQueue = GetRequestExecutionQueue(false, (
TestMethodHandler
.Metadata,
TestMethodHandler
.Instance));
104
var response = (MockResponse?)await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)),
TestMethodHandler
.Name, lspServices, CancellationToken.None);
141
var requestExecutionQueue = GetRequestExecutionQueue(false, (
TestMethodHandler
.Metadata,
TestMethodHandler
.Instance));
145
var task1 = requestExecutionQueue.ExecuteAsync(request,
TestMethodHandler
.Name, lspServices, CancellationToken.None);
146
var task2 = requestExecutionQueue.ExecuteAsync(request,
TestMethodHandler
.Name, lspServices, CancellationToken.None);