提交 d0c07a3c 编写于 作者: J jnm2

Test that generated GlobalSuppressions.cs doesn't have multiple trailing blank lines

上级 b98cf32a
......@@ -858,6 +858,34 @@ public async Task GeneratedCodeShouldNotHaveLeadingBlankLines()
@"
using System;
[|class Class|]
{
int Method()
{
int x = 0;
}
}", expected);
}
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsSuppression)]
public async Task GeneratedCodeShouldNotHaveMoreThanOneTrailingBlankLine()
{
var expected =
$@"// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(""InfoDiagnostic"", ""InfoDiagnostic:InfoDiagnostic"", Justification = ""{FeaturesResources.Pending}"", Scope = ""type"", Target = ""~T:Class"")]
";
var lines = Regex.Split(expected, "\r?\n");
Assert.False(string.IsNullOrWhiteSpace(lines[lines.Length - 2]));
await TestAsync(
@"
using System;
[|class Class|]
{
int Method()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册