{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/comments/131730721","pull_request_review_id":54722087,"id":131730721,"diff_hunk":"@@ -13,8 +17,130 @@ public static class SgenTests\n         [Fact]\n         public static void BasicTest()\n         {\n-            int n = Sgen.Main(null);\n+            int n = Sgen.Main(new string[0]);\n             Assert.Equal(0, n);\n         }\n+\n+        [Fact]\n+        public static void GeneralBaselineTest()\n+        {\n+            string codefile = \"System.Xml.XmlSerializer.Sgen.Data.XmlSerializers.cs\";\n+            if (File.Exists(codefile))\n+            {\n+                File.Delete(codefile);\n+            }\n+\n+            Assert.True(File.Exists(\"System.Xml.XmlSerializer.Sgen.Data.dll\"), string.Format(\"Cannot find file {0}.\", \"System.Xml.XmlSerializer.Sgen.Data.dll\"));\n+            int n = Sgen.Main(new string[] { \"System.Xml.XmlSerializer.Sgen.Data.dll\", \"/force\", \"/casesensitive\"});\n+            Assert.Equal(0, n);\n+            Assert.True(File.Exists(codefile), string.Format(\"Fail to generate {0}.\", codefile));\n+            string basefile = Path.Combine(Directory.GetCurrentDirectory(), \"baseline\", \"System.Xml.XmlSerializer.Sgen.Data.XmlSerializers.cs\");\n+            Assert.True(File.Exists(basefile), string.Format(\"Missing baseline file {0}.\", basefile));\n+\n+\n+            List<string> allbaseclasses = GetAllClassdNames(basefile);\n+            List<string> allclasses = GetAllClassdNames(codefile);\n+            CompareList(allbaseclasses, allclasses);\n+            List<string> allbasemethods = GetAllMethodNames(basefile);\n+            List<string> allmethods = GetAllMethodNames(codefile);\n+            CompareList(allbasemethods, allmethods);\n+            List<string> allbaselines = GetAllLines(basefile);\n+            List<string> alllines = GetAllLines(codefile);\n+            CompareList(allbaselines, alllines);\n+        }\n+\n+        private static List<String> GetAllLines(string strFileName)\n+        {\n+            List<string> methodNames = new List<string>();\n+            var alllines = File.ReadAllLines(strFileName);\n+            var newalllines = new List<string>();\n+            foreach (var line in alllines)\n+            {\n+                if (line == String.Empty)\n+                {\n+                    continue;\n+                }\n+\n+                newalllines.Add(line.Trim());\n+            }\n+\n+            return newalllines;\n+        }\n+\n+        public static List<string> GetAllMethodNames(string strFileName)\n+        {\n+            List<string> methodNames = new List<string>();\n+            var strMethodLines = GetAllLines(strFileName)\n+                            .Where(a => (a.Contains(\"protected\") ||\n+                                         a.Contains(\"private\") ||\n+                                         a.Contains(\"public\")) &&\n+                                         !a.Contains(\"class\"));\n+            foreach (var item in strMethodLines)\n+            {\n+                if (item.IndexOf(\"(\") != -1)\n+                {\n+                    string strTemp = String.Join(\"\", item.Substring(0, item.IndexOf(\"(\")).Reverse());\n+                    methodNames.Add(String.Join(\"\", strTemp.Substring(0, strTemp.IndexOf(\" \")).Reverse()));\n+                }\n+            }\n+\n+            methodNames.Sort();\n+            return methodNames;\n+        }\n+\n+        public static List<string> GetAllClassdNames(string strFileName)\n+        {\n+            List<string> classdNames = new List<string>();\n+            var strMethodLines = GetAllLines(strFileName)\n+            .Where(a => (a.Contains(\"protected\") ||\n+            a.Contains(\"private\") ||\n+            a.Contains(\"public\")) &&\n+            a.Contains(\"class\"));\n+            foreach (var item in strMethodLines)\n+            {\n+                if (item.IndexOf(\"class\") != -1)\n+                {\n+                    string strTemp = String.Join(\"\", item.Substring(0, item.IndexOf(\":\")).Reverse());\n+                    classdNames.Add(String.Join(\"\", strTemp.Substring(0, strTemp.IndexOf(\"ssalc\")).Reverse()));\n+                }\n+            }\n+\n+            classdNames.Sort();\n+            return classdNames;\n+        }\n+\n+        private static void CompareList(List<string> expectedlist, List<string> actuallist)\n+        {\n+            if (expectedlist == null)\n+            {\n+                throw new InvalidDataException(\"The expected list is null\");\n+            }\n+\n+            if (actuallist == null)\n+            {\n+                throw new InvalidDataException(\"The actual list is null\");","path":"src/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs","position":117,"original_position":117,"commit_id":"74c94123e1f6da61d6585f35a62fbabb1e2dc364","original_commit_id":"74c94123e1f6da61d6585f35a62fbabb1e2dc364","user":{"login":"shmao","id":12262109,"avatar_url":"https://avatars1.githubusercontent.com/u/12262109?v=4","gravatar_id":"","url":"https://api.github.com/users/shmao","html_url":"https://github.com/shmao","followers_url":"https://api.github.com/users/shmao/followers","following_url":"https://api.github.com/users/shmao/following{/other_user}","gists_url":"https://api.github.com/users/shmao/gists{/gist_id}","starred_url":"https://api.github.com/users/shmao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shmao/subscriptions","organizations_url":"https://api.github.com/users/shmao/orgs","repos_url":"https://api.github.com/users/shmao/repos","events_url":"https://api.github.com/users/shmao/events{/privacy}","received_events_url":"https://api.github.com/users/shmao/received_events","type":"User","site_admin":false},"body":"ArgumentNullException","created_at":"2017-08-07T18:33:37Z","updated_at":"2017-08-07T18:37:43Z","html_url":"https://github.com/dotnet/corefx/pull/21241#discussion_r131730721","pull_request_url":"https://api.github.com/repos/dotnet/corefx/pulls/21241","_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments/131730721"},"html":{"href":"https://github.com/dotnet/corefx/pull/21241#discussion_r131730721"},"pull_request":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/21241"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/corefx/pulls/21241","id":126410005,"html_url":"https://github.com/dotnet/corefx/pull/21241","diff_url":"https://github.com/dotnet/corefx/pull/21241.diff","patch_url":"https://github.com/dotnet/corefx/pull/21241.patch","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/21241","number":21241,"state":"open","locked":false,"title":"Add automation tests for SGEN.","user":{"login":"huanwu","id":1438378,"avatar_url":"https://avatars1.githubusercontent.com/u/1438378?v=4","gravatar_id":"","url":"https://api.github.com/users/huanwu","html_url":"https://github.com/huanwu","followers_url":"https://api.github.com/users/huanwu/followers","following_url":"https://api.github.com/users/huanwu/following{/other_user}","gists_url":"https://api.github.com/users/huanwu/gists{/gist_id}","starred_url":"https://api.github.com/users/huanwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanwu/subscriptions","organizations_url":"https://api.github.com/users/huanwu/orgs","repos_url":"https://api.github.com/users/huanwu/repos","events_url":"https://api.github.com/users/huanwu/events{/privacy}","received_events_url":"https://api.github.com/users/huanwu/received_events","type":"User","site_admin":false},"body":"Add automation tests for SGEN. It includes two parts. 1. Baseline test 2. Run the existing XML tests on SGEN.\r\n\r\nFix #21147\r\n\r\n@shmao @zhenlan @mconnew \r\n","created_at":"2017-06-19T22:20:11Z","updated_at":"2017-08-07T18:37:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8efb2575b67f8257a14992004f135c838c3b9bd0","assignee":{"login":"huanwu","id":1438378,"avatar_url":"https://avatars1.githubusercontent.com/u/1438378?v=4","gravatar_id":"","url":"https://api.github.com/users/huanwu","html_url":"https://github.com/huanwu","followers_url":"https://api.github.com/users/huanwu/followers","following_url":"https://api.github.com/users/huanwu/following{/other_user}","gists_url":"https://api.github.com/users/huanwu/gists{/gist_id}","starred_url":"https://api.github.com/users/huanwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanwu/subscriptions","organizations_url":"https://api.github.com/users/huanwu/orgs","repos_url":"https://api.github.com/users/huanwu/repos","events_url":"https://api.github.com/users/huanwu/events{/privacy}","received_events_url":"https://api.github.com/users/huanwu/received_events","type":"User","site_admin":false},"assignees":[{"login":"huanwu","id":1438378,"avatar_url":"https://avatars1.githubusercontent.com/u/1438378?v=4","gravatar_id":"","url":"https://api.github.com/users/huanwu","html_url":"https://github.com/huanwu","followers_url":"https://api.github.com/users/huanwu/followers","following_url":"https://api.github.com/users/huanwu/following{/other_user}","gists_url":"https://api.github.com/users/huanwu/gists{/gist_id}","starred_url":"https://api.github.com/users/huanwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanwu/subscriptions","organizations_url":"https://api.github.com/users/huanwu/orgs","repos_url":"https://api.github.com/users/huanwu/repos","events_url":"https://api.github.com/users/huanwu/events{/privacy}","received_events_url":"https://api.github.com/users/huanwu/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/dotnet/corefx/milestones/12","html_url":"https://github.com/dotnet/corefx/milestone/12","labels_url":"https://api.github.com/repos/dotnet/corefx/milestones/12/labels","id":2323293,"number":12,"title":"2.1.0","description":".NET Core 2.1, next major release after 2.0. It will include also all changes from UWP6.0 milestone. See [official release dates](https://github.com/dotnet/core/blob/master/roadmap.md) for details. Due date currently tracks ZBB (zero bug bounce) milestone.","creator":{"login":"karelz","id":5776068,"avatar_url":"https://avatars2.githubusercontent.com/u/5776068?v=4","gravatar_id":"","url":"https://api.github.com/users/karelz","html_url":"https://github.com/karelz","followers_url":"https://api.github.com/users/karelz/followers","following_url":"https://api.github.com/users/karelz/following{/other_user}","gists_url":"https://api.github.com/users/karelz/gists{/gist_id}","starred_url":"https://api.github.com/users/karelz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karelz/subscriptions","organizations_url":"https://api.github.com/users/karelz/orgs","repos_url":"https://api.github.com/users/karelz/repos","events_url":"https://api.github.com/users/karelz/events{/privacy}","received_events_url":"https://api.github.com/users/karelz/received_events","type":"User","site_admin":false},"open_issues":308,"closed_issues":1493,"state":"open","created_at":"2017-02-15T02:14:11Z","updated_at":"2017-08-07T16:55:55Z","due_on":"2017-09-15T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/dotnet/corefx/pulls/21241/commits","review_comments_url":"https://api.github.com/repos/dotnet/corefx/pulls/21241/comments","review_comment_url":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/21241/comments","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/74c94123e1f6da61d6585f35a62fbabb1e2dc364","head":{"label":"huanwu:SgenTestAutomation","ref":"SgenTestAutomation","sha":"74c94123e1f6da61d6585f35a62fbabb1e2dc364","user":{"login":"huanwu","id":1438378,"avatar_url":"https://avatars1.githubusercontent.com/u/1438378?v=4","gravatar_id":"","url":"https://api.github.com/users/huanwu","html_url":"https://github.com/huanwu","followers_url":"https://api.github.com/users/huanwu/followers","following_url":"https://api.github.com/users/huanwu/following{/other_user}","gists_url":"https://api.github.com/users/huanwu/gists{/gist_id}","starred_url":"https://api.github.com/users/huanwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanwu/subscriptions","organizations_url":"https://api.github.com/users/huanwu/orgs","repos_url":"https://api.github.com/users/huanwu/repos","events_url":"https://api.github.com/users/huanwu/events{/privacy}","received_events_url":"https://api.github.com/users/huanwu/received_events","type":"User","site_admin":false},"repo":{"id":61407397,"name":"corefx","full_name":"huanwu/corefx","owner":{"login":"huanwu","id":1438378,"avatar_url":"https://avatars1.githubusercontent.com/u/1438378?v=4","gravatar_id":"","url":"https://api.github.com/users/huanwu","html_url":"https://github.com/huanwu","followers_url":"https://api.github.com/users/huanwu/followers","following_url":"https://api.github.com/users/huanwu/following{/other_user}","gists_url":"https://api.github.com/users/huanwu/gists{/gist_id}","starred_url":"https://api.github.com/users/huanwu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/huanwu/subscriptions","organizations_url":"https://api.github.com/users/huanwu/orgs","repos_url":"https://api.github.com/users/huanwu/repos","events_url":"https://api.github.com/users/huanwu/events{/privacy}","received_events_url":"https://api.github.com/users/huanwu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/huanwu/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others.","fork":true,"url":"https://api.github.com/repos/huanwu/corefx","forks_url":"https://api.github.com/repos/huanwu/corefx/forks","keys_url":"https://api.github.com/repos/huanwu/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/huanwu/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/huanwu/corefx/teams","hooks_url":"https://api.github.com/repos/huanwu/corefx/hooks","issue_events_url":"https://api.github.com/repos/huanwu/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/huanwu/corefx/events","assignees_url":"https://api.github.com/repos/huanwu/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/huanwu/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/huanwu/corefx/tags","blobs_url":"https://api.github.com/repos/huanwu/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/huanwu/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/huanwu/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/huanwu/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/huanwu/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/huanwu/corefx/languages","stargazers_url":"https://api.github.com/repos/huanwu/corefx/stargazers","contributors_url":"https://api.github.com/repos/huanwu/corefx/contributors","subscribers_url":"https://api.github.com/repos/huanwu/corefx/subscribers","subscription_url":"https://api.github.com/repos/huanwu/corefx/subscription","commits_url":"https://api.github.com/repos/huanwu/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/huanwu/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/huanwu/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/huanwu/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/huanwu/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/huanwu/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/huanwu/corefx/merges","archive_url":"https://api.github.com/repos/huanwu/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/huanwu/corefx/downloads","issues_url":"https://api.github.com/repos/huanwu/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/huanwu/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/huanwu/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/huanwu/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/huanwu/corefx/labels{/name}","releases_url":"https://api.github.com/repos/huanwu/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/huanwu/corefx/deployments","created_at":"2016-06-17T23:14:16Z","updated_at":"2016-06-17T23:14:40Z","pushed_at":"2017-08-01T23:43:12Z","git_url":"git://github.com/huanwu/corefx.git","ssh_url":"git@github.com:huanwu/corefx.git","clone_url":"https://github.com/huanwu/corefx.git","svn_url":"https://github.com/huanwu/corefx","homepage":"https://dotnet.github.io/","size":149834,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"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":"dotnet:master","ref":"master","sha":"94e545445818bf18d6609e73dca56d3f36f790d4","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":26295345,"name":"corefx","full_name":"dotnet/corefx","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars0.githubusercontent.com/u/9141961?v=4","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/corefx","description":"This repo contains the .NET Core foundational libraries, called CoreFX. It includes classes for collections, file systems, console, XML, async and many others. We welcome contributions.","fork":false,"url":"https://api.github.com/repos/dotnet/corefx","forks_url":"https://api.github.com/repos/dotnet/corefx/forks","keys_url":"https://api.github.com/repos/dotnet/corefx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/corefx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/corefx/teams","hooks_url":"https://api.github.com/repos/dotnet/corefx/hooks","issue_events_url":"https://api.github.com/repos/dotnet/corefx/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/corefx/events","assignees_url":"https://api.github.com/repos/dotnet/corefx/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/corefx/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/corefx/tags","blobs_url":"https://api.github.com/repos/dotnet/corefx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/corefx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/corefx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/corefx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/corefx/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/corefx/languages","stargazers_url":"https://api.github.com/repos/dotnet/corefx/stargazers","contributors_url":"https://api.github.com/repos/dotnet/corefx/contributors","subscribers_url":"https://api.github.com/repos/dotnet/corefx/subscribers","subscription_url":"https://api.github.com/repos/dotnet/corefx/subscription","commits_url":"https://api.github.com/repos/dotnet/corefx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/corefx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/corefx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/corefx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/corefx/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/corefx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/corefx/merges","archive_url":"https://api.github.com/repos/dotnet/corefx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/corefx/downloads","issues_url":"https://api.github.com/repos/dotnet/corefx/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/corefx/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/corefx/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/corefx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/corefx/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/corefx/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/corefx/deployments","created_at":"2014-11-06T23:42:48Z","updated_at":"2017-08-07T18:04:54Z","pushed_at":"2017-08-07T17:49:33Z","git_url":"git://github.com/dotnet/corefx.git","ssh_url":"git@github.com:dotnet/corefx.git","clone_url":"https://github.com/dotnet/corefx.git","svn_url":"https://github.com/dotnet/corefx","homepage":"https://github.com/dotnet/core","size":153542,"stargazers_count":12258,"watchers_count":12258,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3365,"mirror_url":null,"open_issues_count":1791,"forks":3365,"open_issues":1791,"watchers":12258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/21241"},"html":{"href":"https://github.com/dotnet/corefx/pull/21241"},"issue":{"href":"https://api.github.com/repos/dotnet/corefx/issues/21241"},"comments":{"href":"https://api.github.com/repos/dotnet/corefx/issues/21241/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/21241/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/corefx/pulls/21241/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/corefx/statuses/74c94123e1f6da61d6585f35a62fbabb1e2dc364"}}}}
{"actor":{"display_login":"shmao"}}