Esempio n. 1
0
        public async Task RequestServerAsync_InvokesCSharpLanguageClient()
        {
            // Arrange
            var called         = false;
            var expectedMethod = "textDocument/test";
            var broker         = new TestLanguageClientBroker((contentType, method) =>
            {
                called = true;
                Assert.Equal(CSharpVirtualDocumentFactory.CSharpLSPContentTypeName, contentType);
                Assert.Equal(expectedMethod, method);
            });
            var requestInvoker = new DefaultLSPRequestInvoker(broker);

            // Act
            await requestInvoker.RequestServerAsync <object, object>(expectedMethod, LanguageServerKind.CSharp, new object(), CancellationToken.None).ConfigureAwait(false);

            // Assert
            Assert.True(called);
        }
Esempio n. 2
0
        public async Task RequestServerAsync_InvokesRazorLanguageClient()
        {
            // Arrange
            var called         = false;
            var expectedMethod = "razor/test";
            var broker         = new TestLanguageClientBroker((contentType, method) =>
            {
                called = true;
                Assert.Equal(RazorLSPContentTypeDefinition.Name, contentType);
                Assert.Equal(expectedMethod, method);
            });
            var requestInvoker = new DefaultLSPRequestInvoker(broker);

            // Act
            await requestInvoker.RequestServerAsync <object, object>(expectedMethod, LanguageServerKind.Razor, new object(), CancellationToken.None).ConfigureAwait(false);

            // Assert
            Assert.True(called);
        }