Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.UnitTests/QueryExecution/SpecialActionTests.cs
David Shiflet 839acf67cd Convert most tools service tests to nunit (#1037)
* Remove xunit dependency from testdriver

* swap expected/actual as needed

* Convert Test.Common to nunit

* port hosting unit tests to nunit

* port batchparser integration tests to nunit

* port testdriver.tests to nunit

* fix target to copy dependency

* port servicelayer unittests to nunit

* more unit test fixes

* port integration tests to nunit

* fix test method type

* try using latest windows build for PRs

* reduce test memory use
2020-08-05 13:43:14 -04:00

79 lines
2.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 Microsoft.SqlTools.ServiceLayer.QueryExecution;
using NUnit.Framework;
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.QueryExecution
{
public class SpecialActionTests
{
[Test]
public void SpecialActionInstantiation()
{
// If:
// ... I create a special action object
var specialAction = new SpecialAction();
// Then:
// ... The special action should be set to none and only none
Assert.AreEqual(true, specialAction.None);
Assert.AreEqual(false, specialAction.ExpectYukonXMLShowPlan);
}
[Test]
public void SpecialActionNoneProperty()
{
// If:
// ... I create a special action object and add properties but set it back to none
var specialAction = new SpecialAction();
specialAction.ExpectYukonXMLShowPlan = true;
specialAction.None = true;
// Then:
// ... The special action should be set to none and only none
Assert.AreEqual(true, specialAction.None);
Assert.AreEqual(false, specialAction.ExpectYukonXMLShowPlan);
}
[Test]
public void SpecialActionExpectYukonXmlShowPlanReset()
{
// If:
// ... I create a special action object and add properties but set the property back to false
var specialAction = new SpecialAction();
specialAction.ExpectYukonXMLShowPlan = true;
specialAction.ExpectYukonXMLShowPlan = false;
// Then:
// ... The special action should be set to none and only none
Assert.AreEqual(true, specialAction.None);
Assert.AreEqual(false, specialAction.ExpectYukonXMLShowPlan);
}
[Test]
public void SpecialActionCombiningProperties()
{
// If:
// ... I create a special action object and add properties and combine with the same property
var specialAction = new SpecialAction();
specialAction.ExpectYukonXMLShowPlan = true;
var specialAction2 = new SpecialAction();
specialAction2.ExpectYukonXMLShowPlan = true;
specialAction.CombineSpecialAction(specialAction2);
// Then:
// ... The special action should be set to none and only none
Assert.AreEqual(false, specialAction.None);
Assert.AreEqual(true, specialAction.ExpectYukonXMLShowPlan);
}
}
}