mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
4094 Kusto AAD Authentication Refactor (#1115)
* 4094 Upgraded Kusto.Data and Kusto.Language to 9.0.3. Refactored KustoServiceLayer to use KustoConnectionStringBuilder instead of Sql. * 4094 Refactored KustoClient>Initialize to take connectionString as optional. Removed unused properties from ConnectionService>ParseConnectionString * 4094 Updated Kusto.Data and Kusto.Language nuget packages to 9.0.4. Removed IsDedicatedAdminConnection function in ConnectionService. * 4094 Fixed unit tests
This commit is contained in:
@@ -61,7 +61,7 @@ namespace Microsoft.Kusto.ServiceLayer.UnitTests.DataSource
|
||||
|
||||
var semanticMarkers = DataSourceFactory.GetDefaultSemanticMarkers(DataSourceType.Kusto, parseInfo, file, queryText);
|
||||
|
||||
Assert.AreNotEqual(0, semanticMarkers.Length);
|
||||
Assert.AreEqual(0, semanticMarkers.Length);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Microsoft.Kusto.ServiceLayer.UnitTests.DataSource.DataSourceIntellisen
|
||||
var queryText = ".show databases";
|
||||
var completionItems = KustoIntellisenseHelper.GetDefaultDiagnostics(parseInfo, scriptFile, queryText);
|
||||
|
||||
Assert.AreEqual(6, completionItems.Length);
|
||||
Assert.AreEqual(0, completionItems.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,11 +86,14 @@ namespace Microsoft.Kusto.ServiceLayer.UnitTests.LanguageServices
|
||||
|
||||
Assert.AreEqual("NULL_NULL_NULL_NULL", connectionKey);
|
||||
}
|
||||
|
||||
[TestCase(false)]
|
||||
public void AddConnectionContext_Sets_BindingContext(bool needsMetadata)
|
||||
|
||||
[Test]
|
||||
public void AddConnectionContext_Sets_BindingContext()
|
||||
{
|
||||
var connectionDetails = new ConnectionDetails();
|
||||
var connectionDetails = new ConnectionDetails
|
||||
{
|
||||
AzureAccountToken = "AzureAccountToken"
|
||||
};
|
||||
var connectionFactory = new Mock<IDataSourceConnectionFactory>();
|
||||
var connectionInfo = new ConnectionInfo(connectionFactory.Object, "ownerUri", connectionDetails);
|
||||
|
||||
@@ -103,7 +106,7 @@ namespace Microsoft.Kusto.ServiceLayer.UnitTests.LanguageServices
|
||||
var connectedBindingQueue =
|
||||
new ConnectedBindingQueue(dataSourceFactory.Object);
|
||||
var connectionKey =
|
||||
connectedBindingQueue.AddConnectionContext(connectionInfo, needsMetadata, "featureName");
|
||||
connectedBindingQueue.AddConnectionContext(connectionInfo, false, "featureName");
|
||||
var bindingContext = connectedBindingQueue.GetOrCreateBindingContext(connectionKey);
|
||||
|
||||
Assert.AreEqual(dataSourceMock.Object, bindingContext.DataSource);
|
||||
|
||||
Reference in New Issue
Block a user