{"action":"created","comment":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/30996164","id":30996164,"diff_hunk":"@@ -0,0 +1,156 @@\n+﻿namespace StyleCop.Analyzers.Test.OrderingRules\n+{\n+    using System.Threading;\n+    using System.Threading.Tasks;\n+    using Microsoft.CodeAnalysis;\n+    using Microsoft.CodeAnalysis.Diagnostics;\n+    using StyleCop.Analyzers.OrderingRules;\n+    using TestHelper;\n+    using Xunit;\n+\n+    public class SA1214UnitTests : CodeFixVerifier\n+    {\n+        public string DiagnosticId { get; } = SA1214StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements.DiagnosticId;\n+\n+        [Fact]\n+        public async Task TestEmptySource()\n+        {\n+            var testCode = string.Empty;\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsInClassStaticReadonlyFieldPlacedAfterStaticNonReadonly()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    private static int i = 0;\n+    private static readonly int j = 0;\n+}\";\n+\n+            var expected = new[]\n+            {\n+                this.CSharpDiagnostic().WithLocation(5, 5)\n+            };\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsAllStaticReadonly()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    private static readonly int i = 0;\n+    private static readonly int j = 0;\n+}\";\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsInClassStaticReadonlyFieldPlacedAfterStaticNonReadonlyOneLine()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    private static int i = 0;private static readonly int j = 0;\n+}\";\n+\n+            var expected = new[]\n+            {\n+                this.CSharpDiagnostic().WithLocation(4, 30)\n+            };\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsInClassStaticReadonlyFieldPlacedBeforeStaticNonReadonly()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    private static readonly int i = 0;\n+    private static int j = 0;\n+}\";\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsInClassNonStaticReadonlyFieldPlacedAfterNonStaticNonReadonly()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    private int i = 0;\n+    private readonly int j = 0;\n+}\";\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task TestTwoFieldsInStructStaticReadonlyFieldPlacedAfterStaticNonReadonly()\n+        {\n+            var testCode = @\"\n+public struct Foo\n+{\n+    private static int i = 0;\n+    private static readonly int j = 0;\n+}\";\n+\n+            var expected = new[]\n+            {\n+                this.CSharpDiagnostic().WithLocation(5, 5)\n+            };\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None);\n+        }\n+\n+        [Fact]\n+        public async Task ComplexExample()\n+        {\n+            var testCode = @\"\n+public class Foo\n+{\n+    public string s = \"\"qwe\"\";\n+    private static readonly int i = 0;\n+\n+    public void Ff() {}\n+\n+    public static string s2 = \"\"qwe\"\";\n+\n+    public static readonly int  u = 5;\n+\n+    public class FooInner \n+    {\n+        private int aa = 0;\n+        public static readonly int t = 2;\n+        private static int z = 999;\n+        private static readonly int e = 1;\n+    }\n+\n+    public static readonly int j = 0;\n+}\";\n+\n+            var expected = new[]\n+            {\n+                this.CSharpDiagnostic().WithLocation(11, 5),\n+                this.CSharpDiagnostic().WithLocation(18, 9),\n+                this.CSharpDiagnostic().WithLocation(21, 5),\n+            };\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None);\n+        }\n+\n+\n+        protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()","path":"StyleCop.Analyzers/StyleCop.Analyzers.Test/OrderingRules/SA1214UnitTests.cs","position":151,"original_position":151,"commit_id":"67bd41923ed6b04f43cc60c82e4d857be65f2ce3","original_commit_id":"67bd41923ed6b04f43cc60c82e4d857be65f2ce3","user":{"login":"sharwell","id":1408396,"avatar_url":"https://avatars.githubusercontent.com/u/1408396?v=3","gravatar_id":"","url":"https://api.github.com/users/sharwell","html_url":"https://github.com/sharwell","followers_url":"https://api.github.com/users/sharwell/followers","following_url":"https://api.github.com/users/sharwell/following{/other_user}","gists_url":"https://api.github.com/users/sharwell/gists{/gist_id}","starred_url":"https://api.github.com/users/sharwell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sharwell/subscriptions","organizations_url":"https://api.github.com/users/sharwell/orgs","repos_url":"https://api.github.com/users/sharwell/repos","events_url":"https://api.github.com/users/sharwell/events{/privacy}","received_events_url":"https://api.github.com/users/sharwell/received_events","type":"User","site_admin":false},"body":":bulb: This needs to be updated for the new test API.","created_at":"2015-05-25T22:07:48Z","updated_at":"2015-05-25T22:07:48Z","html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513#discussion_r30996164","pull_request_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513","_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/30996164"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513#discussion_r30996164"},"pull_request":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513"}}},"pull_request":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513","id":30704368,"html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513","diff_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513.diff","patch_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513.patch","issue_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/513","number":513,"state":"closed","locked":false,"title":"Implemented diagnostic for SA1214: StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements","user":{"login":"macpak","id":1065792,"avatar_url":"https://avatars.githubusercontent.com/u/1065792?v=3","gravatar_id":"","url":"https://api.github.com/users/macpak","html_url":"https://github.com/macpak","followers_url":"https://api.github.com/users/macpak/followers","following_url":"https://api.github.com/users/macpak/following{/other_user}","gists_url":"https://api.github.com/users/macpak/gists{/gist_id}","starred_url":"https://api.github.com/users/macpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpak/subscriptions","organizations_url":"https://api.github.com/users/macpak/orgs","repos_url":"https://api.github.com/users/macpak/repos","events_url":"https://api.github.com/users/macpak/events{/privacy}","received_events_url":"https://api.github.com/users/macpak/received_events","type":"User","site_admin":false},"body":"Fixes #74.","created_at":"2015-03-07T15:38:18Z","updated_at":"2015-05-25T22:07:48Z","closed_at":"2015-05-25T22:06:19Z","merged_at":"2015-05-25T22:06:19Z","merge_commit_sha":"1160735935bcb40d7517d845431d5290176cc2a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513/commits","review_comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513/comments","review_comment_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/513/comments","statuses_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/67bd41923ed6b04f43cc60c82e4d857be65f2ce3","head":{"label":"macpak:SA1214","ref":"SA1214","sha":"67bd41923ed6b04f43cc60c82e4d857be65f2ce3","user":{"login":"macpak","id":1065792,"avatar_url":"https://avatars.githubusercontent.com/u/1065792?v=3","gravatar_id":"","url":"https://api.github.com/users/macpak","html_url":"https://github.com/macpak","followers_url":"https://api.github.com/users/macpak/followers","following_url":"https://api.github.com/users/macpak/following{/other_user}","gists_url":"https://api.github.com/users/macpak/gists{/gist_id}","starred_url":"https://api.github.com/users/macpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpak/subscriptions","organizations_url":"https://api.github.com/users/macpak/orgs","repos_url":"https://api.github.com/users/macpak/repos","events_url":"https://api.github.com/users/macpak/events{/privacy}","received_events_url":"https://api.github.com/users/macpak/received_events","type":"User","site_admin":false},"repo":{"id":27834197,"name":"StyleCopAnalyzers","full_name":"macpak/StyleCopAnalyzers","owner":{"login":"macpak","id":1065792,"avatar_url":"https://avatars.githubusercontent.com/u/1065792?v=3","gravatar_id":"","url":"https://api.github.com/users/macpak","html_url":"https://github.com/macpak","followers_url":"https://api.github.com/users/macpak/followers","following_url":"https://api.github.com/users/macpak/following{/other_user}","gists_url":"https://api.github.com/users/macpak/gists{/gist_id}","starred_url":"https://api.github.com/users/macpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/macpak/subscriptions","organizations_url":"https://api.github.com/users/macpak/orgs","repos_url":"https://api.github.com/users/macpak/repos","events_url":"https://api.github.com/users/macpak/events{/privacy}","received_events_url":"https://api.github.com/users/macpak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/macpak/StyleCopAnalyzers","description":"An implementation of StyleCop rules using the .NET Compiler Platform","fork":true,"url":"https://api.github.com/repos/macpak/StyleCopAnalyzers","forks_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/forks","keys_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/teams","hooks_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/events","assignees_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/tags","blobs_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/languages","stargazers_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/subscription","commits_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/merges","archive_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/downloads","issues_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/macpak/StyleCopAnalyzers/releases{/id}","created_at":"2014-12-10T18:45:50Z","updated_at":"2014-12-19T17:46:41Z","pushed_at":"2015-05-16T14:58:11Z","git_url":"git://github.com/macpak/StyleCopAnalyzers.git","ssh_url":"git@github.com:macpak/StyleCopAnalyzers.git","clone_url":"https://github.com/macpak/StyleCopAnalyzers.git","svn_url":"https://github.com/macpak/StyleCopAnalyzers","homepage":null,"size":3320,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"DotNetAnalyzers:master","ref":"master","sha":"d4a2b4b6c05c1c298ec6a901c4f6d3c59dabe109","user":{"login":"DotNetAnalyzers","id":9735576,"avatar_url":"https://avatars.githubusercontent.com/u/9735576?v=3","gravatar_id":"","url":"https://api.github.com/users/DotNetAnalyzers","html_url":"https://github.com/DotNetAnalyzers","followers_url":"https://api.github.com/users/DotNetAnalyzers/followers","following_url":"https://api.github.com/users/DotNetAnalyzers/following{/other_user}","gists_url":"https://api.github.com/users/DotNetAnalyzers/gists{/gist_id}","starred_url":"https://api.github.com/users/DotNetAnalyzers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DotNetAnalyzers/subscriptions","organizations_url":"https://api.github.com/users/DotNetAnalyzers/orgs","repos_url":"https://api.github.com/users/DotNetAnalyzers/repos","events_url":"https://api.github.com/users/DotNetAnalyzers/events{/privacy}","received_events_url":"https://api.github.com/users/DotNetAnalyzers/received_events","type":"Organization","site_admin":false},"repo":{"id":26768275,"name":"StyleCopAnalyzers","full_name":"DotNetAnalyzers/StyleCopAnalyzers","owner":{"login":"DotNetAnalyzers","id":9735576,"avatar_url":"https://avatars.githubusercontent.com/u/9735576?v=3","gravatar_id":"","url":"https://api.github.com/users/DotNetAnalyzers","html_url":"https://github.com/DotNetAnalyzers","followers_url":"https://api.github.com/users/DotNetAnalyzers/followers","following_url":"https://api.github.com/users/DotNetAnalyzers/following{/other_user}","gists_url":"https://api.github.com/users/DotNetAnalyzers/gists{/gist_id}","starred_url":"https://api.github.com/users/DotNetAnalyzers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DotNetAnalyzers/subscriptions","organizations_url":"https://api.github.com/users/DotNetAnalyzers/orgs","repos_url":"https://api.github.com/users/DotNetAnalyzers/repos","events_url":"https://api.github.com/users/DotNetAnalyzers/events{/privacy}","received_events_url":"https://api.github.com/users/DotNetAnalyzers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers","description":"An implementation of StyleCop rules using the .NET Compiler Platform","fork":false,"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers","forks_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/forks","keys_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/teams","hooks_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/events","assignees_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/tags","blobs_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/languages","stargazers_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/subscription","commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/merges","archive_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/downloads","issues_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/releases{/id}","created_at":"2014-11-17T17:29:54Z","updated_at":"2015-05-21T11:53:14Z","pushed_at":"2015-05-25T22:06:19Z","git_url":"git://github.com/DotNetAnalyzers/StyleCopAnalyzers.git","ssh_url":"git@github.com:DotNetAnalyzers/StyleCopAnalyzers.git","clone_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers.git","svn_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers","homepage":null,"size":7685,"stargazers_count":84,"watchers_count":84,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":212,"forks":25,"open_issues":212,"watchers":84,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/513"},"issue":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/513"},"comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/513/comments"},"review_comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513/comments"},"review_comment":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/513/commits"},"statuses":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/67bd41923ed6b04f43cc60c82e4d857be65f2ce3"}}}}