diff --git a/StyleCop.Analyzers/StyleCop.Analyzers.Test/LayoutRules/SA1500/SA1500UnitTests.DoWhiles.cs b/StyleCop.Analyzers/StyleCop.Analyzers.Test/LayoutRules/SA1500/SA1500UnitTests.DoWhiles.cs index 65653a4b8..b0a617a91 100644 --- a/StyleCop.Analyzers/StyleCop.Analyzers.Test/LayoutRules/SA1500/SA1500UnitTests.DoWhiles.cs +++ b/StyleCop.Analyzers/StyleCop.Analyzers.Test/LayoutRules/SA1500/SA1500UnitTests.DoWhiles.cs @@ -373,7 +373,24 @@ private void Bar() while (x == 0) { x = 1; - } while (x == 0) + [|}|] while (x == 0) + { + x = 1; + } + } +}"; + + var fixedCode = @"public class Foo +{ + private void Bar() + { + var x = 0; + + while (x == 0) + { + x = 1; + } + while (x == 0) { x = 1; } @@ -383,10 +400,7 @@ private void Bar() var test = new CSharpTest { TestCode = testCode, - ExpectedDiagnostics = - { - Diagnostic().WithLocation(10, 9), - }, + FixedCode = fixedCode, Settings = testSettings, }; @@ -423,7 +437,7 @@ private void Bar() do { - x = 1; } while (x == 0); + x = 1; [|}|] while (x == 0); } }"; @@ -443,10 +457,6 @@ private void Bar() var test = new CSharpTest { TestCode = testCode, - ExpectedDiagnostics = - { - Diagnostic().WithLocation(9, 20), - }, FixedCode = fixedTestCode, Settings = testSettings, };