diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs b/src/EditorFeatures/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs index 037c1d50402a4ffab2776c716d0f78f10b2263f5..61e671a3fbc987175abc679460869d237ff6c79a 100644 --- a/src/EditorFeatures/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs +++ b/src/EditorFeatures/CSharpTest/Diagnostics/Suppression/SuppressionTests.cs @@ -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()