Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/BinaryQueryExpressionFormatterTests.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

64 lines
2.3 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.Formatter;
using NUnit.Framework;
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Formatter
{
public class BinaryQueryExpressionFormatterTests : FormatterUnitTestsBase
{
[SetUp]
public void Init()
{
InitFormatterUnitTestsBase();
}
[Test]
public void BQE_IndentOperands()
{
FormatOptions options = new FormatOptions();
//options.PlaceEachReferenceOnNewLineInQueryStatements = true;
LoadAndFormatAndCompare("BQE_IndentOperands", GetInputFile("BQE_IndentOperands.sql"),
GetBaselineFile("BQE_IndentOperands.sql"), options, true);
}
[Test]
public void BQE_KeywordCasing_UpperCase()
{
FormatOptions options = new FormatOptions();
options.KeywordCasing = CasingOptions.Uppercase;
LoadAndFormatAndCompare("BQE_KeywordCasing_UpperCase", GetInputFile("BQE_KeywordCasing.sql"),
GetBaselineFile("BQE_KeywordCasing_UpperCase.sql"), options, true);
}
[Test]
public void BQE_KeywordCasing_LowerCase()
{
FormatOptions options = new FormatOptions();
options.KeywordCasing = CasingOptions.Lowercase;
LoadAndFormatAndCompare("BQE_KeywordCasing_LowerCase", GetInputFile("BQE_KeywordCasing.sql"),
GetBaselineFile("BQE_KeywordCasing_LowerCase.sql"), options, true);
}
[Test]
public void BQE_KeywordCasing_NoFormat()
{
FormatOptions options = new FormatOptions();
options.KeywordCasing = CasingOptions.None;
LoadAndFormatAndCompare("BQE_KeywordCasing_NoFormat", GetInputFile("BQE_KeywordCasing.sql"),
GetBaselineFile("BQE_KeywordCasing_NoFormat.sql"), options, true);
}
[Test]
public void BQE_OperatorsOnNewLine()
{
FormatOptions options = new FormatOptions();
LoadAndFormatAndCompare("BQE_OperatorsOnNewLine", GetInputFile("BQE_OperatorsOnNewLine.sql"),
GetBaselineFile("BQE_OperatorsOnNewLine.sql"), options, true);
}
}
}