mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-14 01:25:40 -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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user