mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 01:25:40 -05:00
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
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
//
|
||||
|
||||
#nullable disable
|
||||
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection.ReliableConnection;
|
||||
using NUnit.Framework;
|
||||
using Microsoft.Data.SqlClient;
|
||||
@@ -27,7 +29,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
|
||||
public void CacheMatchesNullDbNameToEmptyString()
|
||||
{
|
||||
// Set sqlDw result into cache
|
||||
string dataSource = "testDataSource";
|
||||
string dataSource = "testDataSource";
|
||||
SqlConnectionStringBuilder testSource = new SqlConnectionStringBuilder
|
||||
{
|
||||
DataSource = dataSource,
|
||||
@@ -70,10 +72,10 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
|
||||
|
||||
cache.AddOrUpdateCache(testSource, state, CachedServerInfo.CacheVariable.EngineEdition);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown) );
|
||||
Assert.That(engineEdition, Is.EqualTo(state), "Expect the same returned result");
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown) );
|
||||
Assert.That(engineEdition, Is.EqualTo(state), "Expect the same returned result");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -89,9 +91,9 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
|
||||
cache.AddOrUpdateCache(testSource, state, CachedServerInfo.CacheVariable.EngineEdition);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown));
|
||||
Assert.That(engineEdition, Is.EqualTo(state), "Expect the same returned result");
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown));
|
||||
Assert.That(engineEdition, Is.EqualTo(state), "Expect the same returned result");
|
||||
});
|
||||
|
||||
DatabaseEngineEdition newState = state == DatabaseEngineEdition.SqlDataWarehouse ?
|
||||
@@ -100,9 +102,9 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
|
||||
cache.AddOrUpdateCache(testSource, newState, CachedServerInfo.CacheVariable.EngineEdition);
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown));
|
||||
Assert.That(engineEdition, Is.EqualTo(newState), "Expect the opposite returned result");
|
||||
{
|
||||
Assert.That(cache.TryGetEngineEdition(testSource, out engineEdition), Is.Not.EqualTo(DatabaseEngineEdition.Unknown));
|
||||
Assert.That(engineEdition, Is.EqualTo(newState), "Expect the opposite returned result");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -150,7 +152,7 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.Connection
|
||||
|
||||
[Test]
|
||||
public void AskforEngineEditionBeforeCached()
|
||||
{
|
||||
{
|
||||
Assert.AreEqual(DatabaseEngineEdition.Unknown, cache.TryGetEngineEdition(new SqlConnectionStringBuilder
|
||||
{
|
||||
DataSource = "testDataSourceUnCached"
|
||||
|
||||
Reference in New Issue
Block a user