Skip to content

Commit

Permalink
GU0023 reversed arguments in error message. Close DotNetAnalyzers#185.
Browse files Browse the repository at this point in the history
There is another bug, the arguments are correct.
  • Loading branch information
JohanLarsson committed Aug 12, 2018
1 parent ce7893f commit 5ccd247
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Gu.Analyzers.Test/GU0023StaticMemberOrderTests/Diagnostics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ internal class Diagnostics
{
private static readonly DiagnosticAnalyzer Analyzer = new GU0023StaticMemberOrderAnalyzer();

[Test]
public void Message()
{
var code = @"
namespace RoslynSandbox
{
public class Foo
{
public static readonly int Value1 = ↓Value2;
public static readonly int Value2 = 2;
}
}";
AnalyzerAssert.Diagnostics(Analyzer, ExpectedDiagnostic.Create("GU0023", "Member 'RoslynSandbox.Foo.Value2' must be declared before 'RoslynSandbox.Foo.Value1'"), code);
}

[Test]
public void FieldInitializedWithField()
{
Expand Down

0 comments on commit 5ccd247

Please sign in to comment.