mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-17 01:25:40 -05:00
Enable user management tests (#1912)
* Enable user management tests * Fix update user test
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
|
||||
using Microsoft.SqlTools.ServiceLayer.Security;
|
||||
using Microsoft.SqlTools.ServiceLayer.Test.Common;
|
||||
using NUnit.Framework;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
/// <summary>
|
||||
/// Test the basic Create User method handler
|
||||
/// </summary>
|
||||
//[Test] - enable tests in separate change
|
||||
[Test]
|
||||
public async Task TestHandleCreateUserWithLoginRequest()
|
||||
{
|
||||
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
|
||||
@@ -27,11 +28,10 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
SecurityService service = new SecurityService();
|
||||
UserServiceHandlerImpl userService = new UserServiceHandlerImpl();
|
||||
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
|
||||
var contextId = System.Guid.NewGuid().ToString();
|
||||
|
||||
var login = await SecurityTestUtils.CreateLogin(service, connectionResult);
|
||||
|
||||
var login = await SecurityTestUtils.CreateLogin(service, connectionResult, contextId);
|
||||
|
||||
var user = await SecurityTestUtils.CreateUser(userService, connectionResult, contextId, login);
|
||||
var user = await SecurityTestUtils.CreateUser(userService, connectionResult, login);
|
||||
|
||||
await SecurityTestUtils.DeleteUser(userService, connectionResult, user);
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
/// <summary>
|
||||
/// Test the basic Update User method handler
|
||||
/// </summary>
|
||||
//[Test] - enable tests in separate change
|
||||
[Test]
|
||||
public async Task TestHandleUpdateUserWithLoginRequest()
|
||||
{
|
||||
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
|
||||
@@ -51,13 +51,12 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Security
|
||||
SecurityService service = new SecurityService();
|
||||
UserServiceHandlerImpl userService = new UserServiceHandlerImpl();
|
||||
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
|
||||
var contextId = System.Guid.NewGuid().ToString();
|
||||
|
||||
var login = await SecurityTestUtils.CreateLogin(service, connectionResult, contextId);
|
||||
var login = await SecurityTestUtils.CreateLogin(service, connectionResult);
|
||||
|
||||
var user = await SecurityTestUtils.CreateUser(userService, connectionResult, contextId, login);
|
||||
var user = await SecurityTestUtils.CreateUser(userService, connectionResult, login);
|
||||
|
||||
await SecurityTestUtils.UpdateUser(userService, connectionResult, contextId, user);
|
||||
await SecurityTestUtils.UpdateUser(userService, connectionResult, user);
|
||||
|
||||
await SecurityTestUtils.DeleteUser(userService, connectionResult, user);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user