{"action":"created","comment":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/25488824","id":25488824,"diff_hunk":"@@ -0,0 +1,152 @@\n+﻿using Microsoft.CodeAnalysis;\n+using Microsoft.VisualStudio.TestTools.UnitTesting;\n+using StyleCop.Analyzers.LayoutRules;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading;\n+using System.Threading.Tasks;\n+using TestHelper;\n+using Microsoft.CodeAnalysis.Diagnostics;\n+using Microsoft.CodeAnalysis.CodeFixes;\n+\n+namespace StyleCop.Analyzers.Test.LayoutRules\n+{\n+    /// <summary>\n+    /// Unit tests for the SA1518: CodeMustNotContainBlankLinesAtEndOfFile\n+    /// </summary>\n+    [TestClass]\n+    public class SA1518UnitTests : CodeFixVerifier\n+    {\n+        private const string DiagnosticId = SA1518CodeMustNotContainBlankLinesAtEndOfFile.DiagnosticId;\n+\n+        private const string BaseCode = @\"using System.Diagnostics;\n+public class Foo\n+{\n+    public void Bar(int i)\n+    {\n+        Debug.Assert(true);\n+    }\n+}\";\n+        \n+        /// <summary>\n+        /// Verifies that the analyzer will properly handle an empty source.\n+        /// </summary>\n+        /// <returns></returns>\n+        [TestMethod, TestCategory(\"MaintainabilityRules/SA1518\")]\n+        public async Task TestEmptySource()\n+        {\n+            var testCode = string.Empty;\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        /// <summary>\n+        /// Verifies that blank lines at the end of the file will produce a warning.\n+        /// </summary>\n+        /// <returns></returns>\n+        [TestMethod, TestCategory(\"MaintainabilityRules/SA1518\")]\n+        public async Task TestWithBlankLinesAtEndOfFile()\n+        {\n+            var testCode = BaseCode + \"\\r\\n\\r\\n\";\n+\n+            var expected = new[]\n+            {\n+                new DiagnosticResult\n+                {\n+                    Id = DiagnosticId,\n+                    Message = \"Code must not contain blank lines at end of file\",\n+                    Severity = DiagnosticSeverity.Warning,\n+                    Locations = new[] { new DiagnosticResultLocation(\"Test0.cs\", 9, 1) }\n+                }\n+            };\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, expected, CancellationToken.None);\n+        }\n+\n+        /// <summary>\n+        /// Verifies that a single carriage return / linefeed at the end of the file will not produce a warning.\n+        /// </summary>\n+        /// <returns></returns>\n+        [TestMethod, TestCategory(\"MaintainabilityRules/SA1518\")]\n+        public async Task TestWithSingleCarriageReturnLineFeedAtEndOfFile()\n+        {\n+            var testCode = BaseCode + \"\\r\\n\";\n+\n+            await this.VerifyCSharpDiagnosticAsync(testCode, EmptyDiagnosticResults, CancellationToken.None);\n+        }\n+\n+        /// <summary>\n+        /// Verifies that a no carriage return / linefeed at the end of the file will not produce a warning.","path":"StyleCop.Analyzers/StyleCop.Analyzers.Test/LayoutRules/SA1518UnitTests.cs","position":80,"original_position":80,"commit_id":"2c9d2219e5bcee0a6fcd22122fa054dac336b8f4","original_commit_id":"2c9d2219e5bcee0a6fcd22122fa054dac336b8f4","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: You might add a comment that SA1513 is reported for this case.","created_at":"2015-02-27T05:43:35Z","updated_at":"2015-02-27T05:43:35Z","html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502#discussion_r25488824","pull_request_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502","_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments/25488824"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502#discussion_r25488824"},"pull_request":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502"}}},"pull_request":{"url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502","id":30116292,"html_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502","diff_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502.diff","patch_url":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502.patch","issue_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/502","number":502,"state":"open","locked":false,"title":"Implemented SA1518 (incl. tests and codefix)","user":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"body":"Fixes #119","created_at":"2015-02-26T21:06:29Z","updated_at":"2015-02-27T05:43:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1d470d222c00de063ddd22900f1bb681930a40f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502/commits","review_comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502/comments","review_comment_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/502/comments","statuses_url":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/2c9d2219e5bcee0a6fcd22122fa054dac336b8f4","head":{"label":"vweijsters:SA1518","ref":"SA1518","sha":"2c9d2219e5bcee0a6fcd22122fa054dac336b8f4","user":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"repo":{"id":30612791,"name":"StyleCopAnalyzers","full_name":"vweijsters/StyleCopAnalyzers","owner":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vweijsters/StyleCopAnalyzers","description":"An implementation of StyleCop rules using the .NET Compiler Platform","fork":true,"url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers","forks_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/forks","keys_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/teams","hooks_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/events","assignees_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/tags","blobs_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/languages","stargazers_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/subscription","commits_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/merges","archive_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/downloads","issues_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/vweijsters/StyleCopAnalyzers/releases{/id}","created_at":"2015-02-10T20:23:05Z","updated_at":"2015-02-26T20:56:02Z","pushed_at":"2015-02-26T20:56:45Z","git_url":"git://github.com/vweijsters/StyleCopAnalyzers.git","ssh_url":"git@github.com:vweijsters/StyleCopAnalyzers.git","clone_url":"https://github.com/vweijsters/StyleCopAnalyzers.git","svn_url":"https://github.com/vweijsters/StyleCopAnalyzers","homepage":null,"size":1064,"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":"7f0f93359122f9a70b4fa09a3b9d6805d9ec77de","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-02-27T05:29:05Z","pushed_at":"2015-02-27T05:29:05Z","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":3000,"stargazers_count":51,"watchers_count":51,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":216,"forks":15,"open_issues":216,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502"},"html":{"href":"https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/502"},"issue":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/502"},"comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/issues/502/comments"},"review_comments":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502/comments"},"review_comment":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/pulls/502/commits"},"statuses":{"href":"https://api.github.com/repos/DotNetAnalyzers/StyleCopAnalyzers/statuses/2c9d2219e5bcee0a6fcd22122fa054dac336b8f4"}}}}