diff --git a/Gu.Analyzers.Test/GU0023StaticMemberOrderTests/Diagnostics.cs b/Gu.Analyzers.Test/GU0023StaticMemberOrderTests/Diagnostics.cs index 5c995e7b..4bb231b8 100644 --- a/Gu.Analyzers.Test/GU0023StaticMemberOrderTests/Diagnostics.cs +++ b/Gu.Analyzers.Test/GU0023StaticMemberOrderTests/Diagnostics.cs @@ -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() {