mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-21 01:25:42 -05:00
Per editor Connect support v0.1
- Basic plumbing to support connections for a URI rather than global connections. Typical use case is editor requests to connect, but this isn't the only possible use - Tests pass but need updating to cover new functionality, and re-enable AutoCompleteService test once there is a ServiceDiscovery component that registers and returns services. This is necessary as .Instance won't allow for dependency injection and proper testing.
This commit is contained in:
committed by
Mitchell Sternke
parent
d191b0483c
commit
402e25f77d
78
test/ServiceHost.Test/Workspace/WorkspaceServiceTests.cs
Normal file
78
test/ServiceHost.Test/Workspace/WorkspaceServiceTests.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
// //
|
||||
// // Copyright (c) Microsoft. All rights reserved.
|
||||
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
// //
|
||||
|
||||
// using Microsoft.SqlTools.ServiceLayer.LanguageServices;
|
||||
// using Microsoft.SqlTools.ServiceLayer.WorkspaceServices.Contracts;
|
||||
// using Microsoft.SqlTools.Test.Utility;
|
||||
// using Xunit;
|
||||
|
||||
// namespace Microsoft.SqlTools.ServiceLayer.Test.Workspace
|
||||
// {
|
||||
// /// <summary>
|
||||
// /// Tests for the ServiceHost Language Service tests
|
||||
// /// </summary>
|
||||
// public class WorkspaceServiceTests
|
||||
// {
|
||||
|
||||
// [Fact]
|
||||
// public async Task ServiceLoadsProfilesOnDemand()
|
||||
// {
|
||||
// // Given an event detailing
|
||||
|
||||
// // when
|
||||
// // Send the configuration change to cause profiles to be loaded
|
||||
// await this.languageServiceClient.SendEvent(
|
||||
// DidChangeConfigurationNotification<LanguageServerSettingsWrapper>.Type,
|
||||
// new DidChangeConfigurationParams<LanguageServerSettingsWrapper>
|
||||
// {
|
||||
// Settings = new LanguageServerSettingsWrapper
|
||||
// {
|
||||
// Powershell = new LanguageServerSettings
|
||||
// {
|
||||
// EnableProfileLoading = true,
|
||||
// ScriptAnalysis = new ScriptAnalysisSettings
|
||||
// {
|
||||
// Enable = false
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
// OutputReader outputReader = new OutputReader(this.protocolClient);
|
||||
|
||||
// Task<EvaluateResponseBody> evaluateTask =
|
||||
// this.SendRequest(
|
||||
// EvaluateRequest.Type,
|
||||
// new EvaluateRequestArguments
|
||||
// {
|
||||
// Expression = "\"PROFILE: $(Assert-ProfileLoaded)\"",
|
||||
// Context = "repl"
|
||||
// });
|
||||
|
||||
// // Try reading up to 10 lines to find the expected output line
|
||||
// string outputString = null;
|
||||
// for (int i = 0; i < 10; i++)
|
||||
// {
|
||||
// outputString = await outputReader.ReadLine();
|
||||
|
||||
// if (outputString.StartsWith("PROFILE"))
|
||||
// {
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // Delete the test profile before any assert failures
|
||||
// // cause the function to exit
|
||||
// File.Delete(currentUserCurrentHostPath);
|
||||
|
||||
// // Wait for the selection to appear as output
|
||||
// await evaluateTask;
|
||||
// Assert.Equal("PROFILE: True", outputString);
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user