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:
David Shiflet
2020-08-05 13:43:14 -04:00
committed by GitHub
parent bf4911795f
commit 839acf67cd
205 changed files with 4146 additions and 4329 deletions

View File

@@ -6,16 +6,17 @@
using Microsoft.SqlTools.ServiceLayer.Connection;
using Microsoft.SqlTools.ServiceLayer.LanguageServices;
using Moq;
using Xunit;
using NUnit.Framework;
namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
{
[TestFixture]
public class DatabaseLocksManagerTests
{
private const string server1 = "server1";
private const string database1 = "database1";
[Fact]
[Test]
public void GainFullAccessShouldDisconnectTheConnections()
{
var connectionLock = new Mock<IConnectedBindingQueue>();
@@ -30,7 +31,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
}
}
[Fact]
[Test]
public void ReleaseAccessShouldConnectTheConnections()
{
var connectionLock = new Mock<IConnectedBindingQueue>();
@@ -45,7 +46,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
}
}
//[Fact]
//[Test]
public void SecondProcessToGainAccessShouldWaitForTheFirstProcess()
{
var connectionLock = new Mock<IConnectedBindingQueue>();
@@ -62,9 +63,9 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
{
secondTimeGettingAccessFails = true;
}
Assert.Equal(secondTimeGettingAccessFails, true);
Assert.AreEqual(true, secondTimeGettingAccessFails);
databaseLocksManager.ReleaseAccess(server1, database1);
Assert.Equal(databaseLocksManager.GainFullAccessToDatabase(server1, database1), true);
Assert.AreEqual(true, databaseLocksManager.GainFullAccessToDatabase(server1, database1));
databaseLocksManager.ReleaseAccess(server1, database1);
}
}