mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-19 17:23:55 -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;
|
||||
@@ -335,11 +337,11 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
|
||||
string[] outCols = insertMatch.Groups[2].Value.Split(", ");
|
||||
Assert.AreEqual(expectedOutput.ExpectedOutColumns, outCols.Length);
|
||||
Assert.That(outCols, Has.All.StartsWith("inserted."), "Output columns match");
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(insertMatch.Groups[3].Value, Does.StartWith("Insert"), "Output table name matches");
|
||||
Assert.That(insertMatch.Groups[3].Value, Does.EndWith("Output"));
|
||||
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(insertMatch.Groups[3].Value, Does.StartWith("Insert"), "Output table name matches");
|
||||
Assert.That(insertMatch.Groups[3].Value, Does.EndWith("Output"));
|
||||
});
|
||||
}
|
||||
else
|
||||
@@ -355,19 +357,19 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
|
||||
//
|
||||
string[] outCols = insertMatch.Groups[3].Value.Split(", ");
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.AreEqual(expectedOutput.ExpectedOutColumns, outCols.Length);
|
||||
Assert.That(outCols, Has.All.StartsWith("inserted."), "Output columns match");
|
||||
{
|
||||
Assert.AreEqual(expectedOutput.ExpectedOutColumns, outCols.Length);
|
||||
Assert.That(outCols, Has.All.StartsWith("inserted."), "Output columns match");
|
||||
});
|
||||
|
||||
// In columns match
|
||||
string[] inCols = insertMatch.Groups[2].Value.Split(", ");
|
||||
Assert.AreEqual(expectedOutput.ExpectedInColumns, inCols.Length);
|
||||
|
||||
// Output table name matches
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(insertMatch.Groups[4].Value, Does.StartWith("Insert"));
|
||||
Assert.AreEqual(expectedOutput.ExpectedInColumns, inCols.Length);
|
||||
|
||||
// Output table name matches
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(insertMatch.Groups[4].Value, Does.StartWith("Insert"));
|
||||
Assert.That(insertMatch.Groups[4].Value, Does.EndWith("Output"));
|
||||
});
|
||||
|
||||
@@ -469,9 +471,9 @@ namespace Microsoft.SqlTools.ServiceLayer.UnitTests.EditData
|
||||
Assert.AreEqual(rc.newCells.Length, er.Cells.Length);
|
||||
Assert.AreEqual(SR.EditDataComputedColumnPlaceholder, er.Cells[0].DisplayValue);
|
||||
Assert.False(er.Cells[0].IsNull);
|
||||
Assert.True(er.Cells[0].IsDirty);
|
||||
|
||||
// ... The rest of the cells should have empty display values
|
||||
Assert.True(er.Cells[0].IsDirty);
|
||||
|
||||
// ... The rest of the cells should have empty display values
|
||||
Assert.That(er.Cells.Skip(1).Select(ec => new { ec.DisplayValue, ec.IsNull, ec.IsDirty }), Has.All.EqualTo(new { DisplayValue = string.Empty, IsNull = false, IsDirty = true }));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user