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