Files
sqltoolsservice/test/Microsoft.SqlTools.ServiceLayer.UnitTests/Formatter/BinaryQueryExpressionFormatterTests.cs
Karl Burtram f288bee294 Make nullable warnings a per file opt-in (#1842)
* Make nullable warnings a per file opt-in

* Remove unneeded compiler directives

* Remove compiler directive for User Data
2023-02-03 18:10:07 -08:00

66 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.
//
#nullable disable
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);
}
}
}