6 instantiations of MockResponse
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (6)
Mocks\TestMethodHandlers.cs (6)
27
=> Task.FromResult<MockResponse>(
new
("stuff"));
42
=> Task.FromResult(new
MockResponse
("true"));
98
return Task.FromResult(new
MockResponse
(string.Empty));
117
return
new
("I completed!");
170
=> Task.FromResult(new
MockResponse
(string.Empty));
186
=> Task.FromResult(new
MockResponse
("xaml"));
29 references to MockResponse
Microsoft.CommonLanguageServerProtocol.Framework.UnitTests (29)
Mocks\TestMethodHandlers.cs (25)
16
internal class TestMethodHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
23
public static TypeRef ResponseType = TypeRef.Of<
MockResponse
>();
26
public Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
27
=> Task.FromResult<
MockResponse
>(new("stuff"));
31
internal class TestParameterlessMethodHandler : IRequestHandler<
MockResponse
, TestRequestContext>
38
public static TypeRef ResponseTypeRef = TypeRef.Of<
MockResponse
>();
41
public Task<
MockResponse
> HandleRequestAsync(TestRequestContext context, CancellationToken cancellationToken)
83
internal class MutatingHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
88
public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<
MockResponse
>(), LanguageServerConstants.DefaultLanguageName);
96
public Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
103
internal class CompletingHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
107
public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<
MockResponse
>(), LanguageServerConstants.DefaultLanguageName);
111
public async Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
125
internal class CancellingHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
129
public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<
MockResponse
>(), LanguageServerConstants.DefaultLanguageName);
133
public async Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
144
internal class ThrowingHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
148
public static readonly RequestHandlerMetadata Metadata = new(Name, RequestTypeRef: TypeRef.Of<MockRequest>(), ResponseTypeRef: TypeRef.Of<
MockResponse
>(), LanguageServerConstants.DefaultLanguageName);
152
public Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
159
internal class TestDefaultLanguageHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
166
public static TypeRef ResponseType = TypeRef.Of<
MockResponse
>();
169
public Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
174
internal class TestXamlLanguageHandler : IRequestHandler<MockRequest,
MockResponse
, TestRequestContext>
182
public static TypeRef ResponseType = TypeRef.Of<
MockResponse
>();
185
public Task<
MockResponse
> HandleRequestAsync(MockRequest request, TestRequestContext context, CancellationToken cancellationToken)
RequestExecutionQueueTests.cs (4)
104
var
response = (
MockResponse
?)await requestExecutionQueue.ExecuteAsync(JToken.FromObject(new MockRequest(1)), TestMethodHandler.Name, lspServices, CancellationToken.None);
114
var
response = (
MockResponse
?)await requestExecutionQueue.ExecuteAsync(serializedRequest: null, TestParameterlessMethodHandler.Name, lspServices, CancellationToken.None);