mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -05:00
Get Connection String request handler (#665)
This commit is contained in:
@@ -7,10 +7,11 @@ using System.Data.Common;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using Xunit;
|
||||
using Microsoft.SqlTools.ServiceLayer.QueryExecution;
|
||||
using Microsoft.SqlTools.ServiceLayer.SqlContext;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Connection
|
||||
{
|
||||
@@ -103,5 +104,24 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Connection
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test HandleGetConnectionStringRequest
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void GetCurrentConnectionStringTest()
|
||||
{
|
||||
// If we make a connection to a live database
|
||||
ConnectionService service = ConnectionService.Instance;
|
||||
var result = LiveConnectionHelper.InitLiveConnectionInfo();
|
||||
var requestContext = new Mock<SqlTools.Hosting.Protocol.RequestContext<string>>();
|
||||
var requestParams = new GetConnectionStringParams()
|
||||
{
|
||||
OwnerUri = result.ConnectionInfo.OwnerUri
|
||||
};
|
||||
|
||||
await service.HandleGetConnectionStringRequest(requestParams, requestContext.Object);
|
||||
requestContext.VerifyAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user