mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
* experimental showplan implementation (tools side only) * fix for redundant massages from showplan executions * moved showplan batches to new variables to make it less confusing * returns showplan as part of batch summary with in each result summary * cleaned up showplan resultsets * cleaning up code and making showplan var optional * changes all var names to showplan * adding estimated support * small fixes * updatin var names and adding EPOptions struct * adding ssms execution plan logic based on server types * adding special actions logic * removing redundant name changes * execution plan query handler added * cleaning up functions and data structures * seperated special actions into its own class * cleaning up special actions * cleaning up code * small new line fixes * commenting out pre-yukon code * removing all pre yukon code * last yukon code commented out * fixes broken tests * adding related unit tests; integration tests incoming * finishing tests and cleaning up code * semantic changes * cleaning up semantics * changes and test fixes, also adding new exceptions into RS * fixing special actions and cleaning up request logic * fixing comment to trigger new build * triggering another build * fixed up specialaction and added tests for it
80 lines
2.7 KiB
C#
80 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 Microsoft.SqlTools.ServiceLayer.Test.Utility;
|
|
using Xunit;
|
|
|
|
namespace Microsoft.SqlTools.ServiceLayer.Test.QueryExecution
|
|
{
|
|
public class SpecialActionTests
|
|
{
|
|
|
|
[Fact]
|
|
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.Equal(true, specialAction.None);
|
|
Assert.Equal(false, specialAction.ExpectYukonXMLShowPlan);
|
|
}
|
|
|
|
[Fact]
|
|
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.Equal(true, specialAction.None);
|
|
Assert.Equal(false, specialAction.ExpectYukonXMLShowPlan);
|
|
}
|
|
|
|
[Fact]
|
|
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.Equal(true, specialAction.None);
|
|
Assert.Equal(false, specialAction.ExpectYukonXMLShowPlan);
|
|
}
|
|
|
|
[Fact]
|
|
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.Equal(false, specialAction.None);
|
|
Assert.Equal(true, specialAction.ExpectYukonXMLShowPlan);
|
|
}
|
|
|
|
|
|
}
|
|
}
|