From 5ccd24722e03030040dd7c1832a3ef8fe98a5a3d Mon Sep 17 00:00:00 2001 From: JohanLarsson Date: Sun, 12 Aug 2018 16:57:44 +0200 Subject: [PATCH] GU0023 reversed arguments in error message. Close #185. There is another bug, the arguments are correct. --- .../GU0023StaticMemberOrderTests/Diagnostics.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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() {