mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 09:59:48 -05:00
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
This commit is contained in:
@@ -15,7 +15,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Xunit;
|
||||
using NUnit.Framework;
|
||||
using static Microsoft.SqlTools.ServiceLayer.IntegrationTests.Utility.LiveConnectionHelper;
|
||||
|
||||
namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
@@ -76,8 +76,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
/// <summary>
|
||||
/// Verify the script object request
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async void ScriptingScript()
|
||||
[Test]
|
||||
public async Task ScriptingScript()
|
||||
{
|
||||
foreach (string obj in objects)
|
||||
{
|
||||
@@ -86,8 +86,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsCreateTable()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsCreateTable()
|
||||
{
|
||||
string query = @"CREATE TABLE testTable1 (c1 int)
|
||||
GO
|
||||
@@ -110,8 +110,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAsForMultipleObjects(query, new List<ScriptingObject> { scriptingObject }, scriptCreateDrop, expectedScripts);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsExecuteTableFailes()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsExecuteTableFailes()
|
||||
{
|
||||
string query = "CREATE TABLE testTable1 (c1 int)";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Execute;
|
||||
@@ -125,8 +125,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsAlter()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsAlter()
|
||||
{
|
||||
string query = @"CREATE PROCEDURE testSp1 @StartProductID [int] AS BEGIN Select * from sys.all_columns END
|
||||
GO
|
||||
@@ -168,8 +168,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
}
|
||||
|
||||
// TODO: Fix flaky test. See https://github.com/Microsoft/sqltoolsservice/issues/631
|
||||
// [Fact]
|
||||
public async void VerifyScriptAsExecuteStoredProcedure()
|
||||
// [Test]
|
||||
public async Task VerifyScriptAsExecuteStoredProcedure()
|
||||
{
|
||||
string query = @"CREATE PROCEDURE testSp1
|
||||
@BusinessEntityID [int],
|
||||
@@ -192,8 +192,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsSelectTable()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsSelectTable()
|
||||
{
|
||||
string query = "CREATE TABLE testTable1 (c1 int)";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Select;
|
||||
@@ -208,8 +208,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsCreateView()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsCreateView()
|
||||
{
|
||||
string query = "CREATE VIEW testView1 AS SELECT * from sys.all_columns";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Create;
|
||||
@@ -224,8 +224,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsCreateStoredProcedure()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsCreateStoredProcedure()
|
||||
{
|
||||
string query = "CREATE PROCEDURE testSp1 AS BEGIN Select * from sys.all_columns END";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Create;
|
||||
@@ -240,8 +240,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsDropTable()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsDropTable()
|
||||
{
|
||||
string query = "CREATE TABLE testTable1 (c1 int)";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Delete;
|
||||
@@ -256,8 +256,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsDropView()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsDropView()
|
||||
{
|
||||
string query = "CREATE VIEW testView1 AS SELECT * from sys.all_columns";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Delete;
|
||||
@@ -272,8 +272,8 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.Scripting
|
||||
await VerifyScriptAs(query, scriptingObject, scriptCreateDrop, expectedScript);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async void VerifyScriptAsDropStoredProcedure()
|
||||
[Test]
|
||||
public async Task VerifyScriptAsDropStoredProcedure()
|
||||
{
|
||||
string query = "CREATE PROCEDURE testSp1 AS BEGIN Select * from sys.all_columns END";
|
||||
ScriptingOperationType scriptCreateDrop = ScriptingOperationType.Delete;
|
||||
|
||||
Reference in New Issue
Block a user