Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.IntegrationTests/Agent/AgentOperatorTests.cs
Karl Burtram 372ca0cbe8 Agent configuration support classes (WIP) (#632)
* Additional SQL Agent config classes (WIP)

* Fix build breaks

* Clean up job step code

* Add VS Code build files

* Move changes to other machine

* More of the action execution classes

* More execution processing refactors

* More refactoring

* Disable tests for WIP merge

* Fix break on Release config

* Stage changes to other machine.
2018-06-07 12:08:24 -07:00

51 lines
1.7 KiB
C#

//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using System.Threading.Tasks;
using Microsoft.SqlTools.Hosting.Protocol;
using Microsoft.SqlTools.ServiceLayer.Agent;
using Microsoft.SqlTools.ServiceLayer.Agent.Contracts;
using Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility;
using Microsoft.SqlTools.ServiceLayer.Test.Common;
using Moq;
using Xunit;
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Agent
{
public class AgentOperatorTests
{
/// <summary>
/// Verify the default "update agent alert" request handler with valid parameters
/// </summary>
//[Fact]
public async Task TestHandleUpdateAgentOperatorRequest()
{
using (SelfCleaningTempFile queryTempFile = new SelfCleaningTempFile())
{
var createContext = new Mock<RequestContext<CreateAgentOperatorResult>>();
var service = new AgentService();
var operatorInfo = new AgentOperatorInfo()
{
Id = 10,
Name = "Joe DBA",
EmailAddress = "test@aol.com"
};
var connectionResult = await LiveConnectionHelper.InitLiveConnectionInfoAsync("master", queryTempFile.FilePath);
await service.HandleCreateAgentOperatorRequest(new CreateAgentOperatorParams
{
OwnerUri = connectionResult.ConnectionInfo.OwnerUri,
Operator = operatorInfo
}, createContext.Object);
createContext.VerifyAll();
}
}
}
}