Fix handling some SQL Assessment warnings (#1114)

* Some new SQL Assessment warnings may have Check property set to null. Handle the warnings with no exception.
* Make names of SQL Assessment test methods more informative.
This commit is contained in:
Aleksei Guzev
2020-11-04 22:13:46 +03:00
committed by GitHub
parent 954df47ec9
commit 11960fd904
3 changed files with 14 additions and 14 deletions

View File

@@ -27,7 +27,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SqlAssessment
{
private delegate Task<List<TResult>> AssessmentMethod<TResult>(SqlObjectLocator locator);
private static readonly string[] AllowedSeverityLevels = { "Information", "Warning", "Critical" };
private static readonly string[] AllowedSeverityLevels = { string.Empty, "Information", "Warning", "Critical" };
[Test]
public async Task InvokeSqlAssessmentServerTest()
@@ -56,7 +56,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SqlAssessment
}
[Test]
public async Task GetAssessmentItemsServerTest()
public async Task GetSqlAssessmentItemsServerTest()
{
var liveConnection = LiveConnectionHelper.InitLiveConnectionInfo("master");
@@ -81,7 +81,7 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SqlAssessment
}
[Test]
public async Task GetAssessmentItemsDatabaseTest()
public async Task GetSqlAssessmentItemsDatabaseTest()
{
const string DatabaseName = "tempdb";
var liveConnection = LiveConnectionHelper.InitLiveConnectionInfo(DatabaseName);
@@ -214,9 +214,9 @@ namespace Microsoft.SqlTools.ServiceLayer.IntegrationTests.SqlAssessment
{
Assert.Multiple(() =>
{
Assert.That(item.CheckId, Is.Not.Null.Or.Empty);
Assert.That(item.DisplayName, Is.Not.Null.Or.Empty);
Assert.That(item.Description, Is.Not.Null.Or.Empty);
Assert.That(item.CheckId, Is.Not.Null);
Assert.That(item.DisplayName, Is.Not.Null);
Assert.That(item.Description, Is.Not.Null);
Assert.NotNull(item.Tags);
Assert.That(item.Tags, Has.All.Not.Null.Or.Empty);
});