Kusto AdminService Unit Tests (#1257)

* Added unit tests for AdminService. Added interface for IConnectionService.

* Kusto connection map to ConnectionManager (#1258)

* Created ConnectionManager and moved connectionMap. Changed references from ConnectionService to ConnectionManager.

* Changed creation of ConnectionManager to MEF instead of Instance creation
This commit is contained in:
Justin M
2021-10-07 11:46:13 -07:00
committed by GitHub
parent 2e08873246
commit f2da10f23a
15 changed files with 333 additions and 94 deletions

View File

@@ -47,6 +47,8 @@ namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer
/// </summary>
private ObjectExplorerSettings _settings;
private IConnectionManager _connectionManager;
/// <summary>
/// Singleton constructor
/// </summary>
@@ -78,6 +80,7 @@ namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer
Validate.IsNotNull(nameof(provider), provider);
_serviceProvider = provider;
_connectionService = provider.GetService<ConnectionService>();
_connectionManager = provider.GetService<IConnectionManager>();
try
{
@@ -425,7 +428,7 @@ namespace Microsoft.Kusto.ServiceLayer.ObjectExplorer
ConnectionInfo connectionInfo;
ConnectionCompleteParams connectionResult = await Connect(connectParams, uri);
if (!_connectionService.TryFindConnection(uri, out connectionInfo))
if (!_connectionManager.TryGetValue(uri, out connectionInfo))
{
return null;
}