mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 17:23:27 -05:00
* 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
89 lines
3.0 KiB
C#
89 lines
3.0 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 InsertFormatterTests : FormatterUnitTestsBase
|
|
{
|
|
[SetUp]
|
|
public void Init()
|
|
{
|
|
InitFormatterUnitTestsBase();
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_DefaultValues()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_DefaultValues", GetInputFile("Insert_DefaultValues.sql"),
|
|
GetBaselineFile("Insert_DefaultValues.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_OpenQuery()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_OpenQuery", GetInputFile("Insert_OpenQuery.sql"),
|
|
GetBaselineFile("Insert_OpenQuery.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_OutputInto()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_OutputInto", GetInputFile("Insert_OutputInto.sql"),
|
|
GetBaselineFile("Insert_OutputInto.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_OutputStatement()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_OutputStatement", GetInputFile("Insert_OutputStatement.sql"),
|
|
GetBaselineFile("Insert_OutputStatement.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_Select()
|
|
{
|
|
FormatOptions options = new FormatOptions();
|
|
options.PlaceEachReferenceOnNewLineInQueryStatements = true;
|
|
LoadAndFormatAndCompare("Insert_Select", GetInputFile("Insert_Select.sql"),
|
|
GetBaselineFile("Insert_Select.sql"), options, true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_SelectSource()
|
|
{
|
|
FormatOptions options = new FormatOptions();
|
|
options.PlaceEachReferenceOnNewLineInQueryStatements = true;
|
|
LoadAndFormatAndCompare("Insert_SelectSource", GetInputFile("Insert_SelectSource.sql"),
|
|
GetBaselineFile("Insert_SelectSource.sql"), options, true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_TopSpecification()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_TopSpecification", GetInputFile("Insert_TopSpecification.sql"),
|
|
GetBaselineFile("Insert_TopSpecification.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_TopWithComments()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_TopWithComments", GetInputFile("Insert_TopWithComments.sql"),
|
|
GetBaselineFile("Insert_TopWithComments.sql"), new FormatOptions(), true);
|
|
}
|
|
|
|
[Test]
|
|
public void Insert_Full()
|
|
{
|
|
LoadAndFormatAndCompare("Insert_Full", GetInputFile("Insert_Full.sql"),
|
|
GetBaselineFile("Insert_Full.sql"), new FormatOptions(), true);
|
|
}
|
|
}
|
|
}
|