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

@@ -384,14 +384,14 @@ namespace Microsoft.SqlTools.ServiceLayer.SqlAssessment
{
var item = new AssessmentResultItem
{
CheckId = r.Check.Id,
Description = r.Check.Description,
DisplayName = r.Check.DisplayName,
HelpLink = r.Check.HelpLink,
Level = r.Check.Level.ToString(),
CheckId = r.Check?.Id ?? string.Empty,
Description = r.Check?.Description ?? string.Empty,
DisplayName = r.Check?.DisplayName ?? string.Empty,
HelpLink = r.Check?.HelpLink ?? string.Empty,
Level = r.Check?.Level.ToString() ?? string.Empty,
Message = r.Message,
TargetName = r.TargetPath,
Tags = r.Check.Tags.ToArray(),
Tags = r.Check?.Tags.ToArray() ?? Array.Empty<string>(),
TargetType = r.TargetType,
RulesetVersion = Engine.Configuration.DefaultRuleset.Version.ToString(),
RulesetName = Engine.Configuration.DefaultRuleset.Name,