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:
Karl Burtram
2023-02-03 18:10:07 -08:00
committed by GitHub
parent 735517a503
commit f288bee294
1020 changed files with 2299 additions and 273 deletions

View File

@@ -3,6 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#nullable disable
using System;
using System.Collections.Generic;
using System.Data.Common;
@@ -185,32 +187,32 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
Assert.Throws<InvalidOperationException>(() => new CellUpdate(col, value));
}
/// <summary>
/// Not using TestCaseSource because nUnit's test name generator
/// doesn't like DbColumnWrapper objects as a source, due
/// to that class lacking a ToString override.
/// </summary>
/// <param name="col"></param>
/// <summary>
/// Not using TestCaseSource because nUnit's test name generator
/// doesn't like DbColumnWrapper objects as a source, due
/// to that class lacking a ToString override.
/// </summary>
/// <param name="col"></param>
/// <param name="obj"></param>
[Test]
public void RoundTripTest()
{
foreach (var inputs in RoundTripTestParams)
{
var col = (DbColumnWrapper)inputs[0];
var obj = inputs[1];
// Setup: Figure out the test string
string testString = obj.ToString();
// If: I attempt to create a CellUpdate
CellUpdate cu = new CellUpdate(col, testString);
// Then: The value and type should match what we put in
Assert.That(cu.Value, Is.InstanceOf(col.DataType));
Assert.AreEqual(obj, cu.Value);
Assert.AreEqual(testString, cu.ValueAsString);
Assert.AreEqual(col, cu.Column);
foreach (var inputs in RoundTripTestParams)
{
var col = (DbColumnWrapper)inputs[0];
var obj = inputs[1];
// Setup: Figure out the test string
string testString = obj.ToString();
// If: I attempt to create a CellUpdate
CellUpdate cu = new CellUpdate(col, testString);
// Then: The value and type should match what we put in
Assert.That(cu.Value, Is.InstanceOf(col.DataType));
Assert.AreEqual(obj, cu.Value);
Assert.AreEqual(testString, cu.ValueAsString);
Assert.AreEqual(col, cu.Column);
}
}