{"action":"created","comment":{"url":"https://api.github.com/repos/nunit/nunit/pulls/comments/218546398","pull_request_review_id":156509517,"id":218546398,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODU0NjM5OA==","diff_hunk":"@@ -240,17 +242,16 @@ private static MethodInfo FindContainsKeyMethod(Type type)\n                 {\n                     method = definition\n                              .GetMethods(BindingFlags.Instance | BindingFlags.Public)\n-                             .FirstOrDefault(m =>\n-                                 m.ReturnType == typeof(bool)\n-                                 && m.Name == \"Contains\"\n-                                 && !m.IsGenericMethod\n-                                 && m.GetParameters().Length == 1\n-                                 && m.GetParameters()[0].ParameterType == tKeyGenericArg);\n+                             .FirstOrDefault(m => m.ReturnType == typeof(bool) &&\n+                                                  m.Name == ContainsMethodName &&\n+                                                  !m.IsGenericMethod &&\n+                                                  m.GetParameters().Length == 1 &&\n+                                                  m.GetParameters()[0].ParameterType == tKeyGenericArg);\n \n                     if (method != null)\n                     {\n #if NETSTANDARD1_4\n-                        method = methods.Single(m => Matched(method, m));\n+                        method = methods.Where(x => x.Name == ContainsMethodName).Single(m => MatchedContainsMethod(m, method));","path":"src/NUnitFramework/framework/Constraints/DictionaryContainsKeyConstraint.cs","position":36,"original_position":36,"commit_id":"633593f40d00295d99f4d6a7838747ecd6302d01","original_commit_id":"633593f40d00295d99f4d6a7838747ecd6302d01","user":{"login":"jnm2","id":8040367,"node_id":"MDQ6VXNlcjgwNDAzNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/8040367?v=4","gravatar_id":"","url":"https://api.github.com/users/jnm2","html_url":"https://github.com/jnm2","followers_url":"https://api.github.com/users/jnm2/followers","following_url":"https://api.github.com/users/jnm2/following{/other_user}","gists_url":"https://api.github.com/users/jnm2/gists{/gist_id}","starred_url":"https://api.github.com/users/jnm2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnm2/subscriptions","organizations_url":"https://api.github.com/users/jnm2/orgs","repos_url":"https://api.github.com/users/jnm2/repos","events_url":"https://api.github.com/users/jnm2/events{/privacy}","received_events_url":"https://api.github.com/users/jnm2/received_events","type":"User","site_admin":false},"body":"`.Where(x => cond1).Single(x => cond2)` is a less performant but logically equivalent version of `.Single(x => cond1 && cond2)`. \r\n\r\n```c#\r\nmethod = methods.Single(m => m.Name == ContainsMethodName && MatchedContainsMethod(m, method));\r\n```\r\n\r\nSo if you inline the `MatchContainsMethods` method into the lambda, it shows what the code is effectively doing:\r\n\r\n```c#\r\nmethod = methods.Single(m =>\r\n    m.Name == ContainsMethodName &&\r\n    m.Name == method.Name &&\r\n    m.GetParameters().Length == 1 &&\r\n    method.GetParameters().Length == 1 &&\r\n    m.GetParameters()[0].Name == method.GetParameters()[0].Name);\r\n```\r\n\r\nIt's the `m.Name == ContainsMethodName && m.Name == method.Name` that I noticed. :D\r\n","created_at":"2018-09-18T18:33:17Z","updated_at":"2018-09-18T18:33:17Z","html_url":"https://github.com/nunit/nunit/pull/3000#discussion_r218546398","pull_request_url":"https://api.github.com/repos/nunit/nunit/pulls/3000","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/nunit/nunit/pulls/comments/218546398"},"html":{"href":"https://github.com/nunit/nunit/pull/3000#discussion_r218546398"},"pull_request":{"href":"https://api.github.com/repos/nunit/nunit/pulls/3000"}},"in_reply_to_id":216836085},"pull_request":{"url":"https://api.github.com/repos/nunit/nunit/pulls/3000","id":212562893,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTYyODkz","html_url":"https://github.com/nunit/nunit/pull/3000","diff_url":"https://github.com/nunit/nunit/pull/3000.diff","patch_url":"https://github.com/nunit/nunit/pull/3000.patch","issue_url":"https://api.github.com/repos/nunit/nunit/issues/3000","number":3000,"state":"open","locked":false,"title":"Error in .NET Standard 1.4 DictionaryContainsKeyConstraint MetadataToken compatibility methods","user":{"login":"DaiMichael","id":16304575,"node_id":"MDQ6VXNlcjE2MzA0NTc1","avatar_url":"https://avatars2.githubusercontent.com/u/16304575?v=4","gravatar_id":"","url":"https://api.github.com/users/DaiMichael","html_url":"https://github.com/DaiMichael","followers_url":"https://api.github.com/users/DaiMichael/followers","following_url":"https://api.github.com/users/DaiMichael/following{/other_user}","gists_url":"https://api.github.com/users/DaiMichael/gists{/gist_id}","starred_url":"https://api.github.com/users/DaiMichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaiMichael/subscriptions","organizations_url":"https://api.github.com/users/DaiMichael/orgs","repos_url":"https://api.github.com/users/DaiMichael/repos","events_url":"https://api.github.com/users/DaiMichael/events{/privacy}","received_events_url":"https://api.github.com/users/DaiMichael/received_events","type":"User","site_admin":false},"body":"@ChrisMaddock @oznetmaster \r\nAs per the #2994 comments.\r\n\r\nI've gone with a signature matching routine. Remember this is for `.NET Standard 1.4` only, I'm hoping the use case is low, I'm expecting the users in the \"wild\" is low and most people would be using > 1.6, I can but hope.\r\n\r\nAs per C# specification... I've been looking... basically a signature to be unique needs to be method name and parameter combination. Doesn't even need to worry about return type as you can't overload. \r\n\r\nIn this instance we know we are trying to match \r\n- `Contains` method.\r\n- Return type will always be `bool`, or same for all instances of the method.\r\n- Generic type with name `TKey`.\r\n\r\nSo the signature matches against all the methods of the main type with the filtered list. We know the above points. So I basically try to construct the signature matching the method with those types. \r\n\r\n`TKey` is hard coded as per all code paths.\r\nParameter Name (usually `key`) is matched as per the method, this will allow us to match if the user changes the parameter name when overriding.\r\n\r\nAm I loving it... hmm... I'll go with it works and it is probably better than the last code. We could just support `1.6 ` upwards and this would go away 😃 \r\n\r\nDebuging against `.NetCore` is hard work..... \r\n\r\nFixes #2994","created_at":"2018-09-01T20:23:34Z","updated_at":"2018-09-18T18:33:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7736b2bb058a6d29caa7fcf5634a4fa552aefa07","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":805813973,"node_id":"MDU6TGFiZWw4MDU4MTM5NzM=","url":"https://api.github.com/repos/nunit/nunit/labels/awaiting:contributor","name":"awaiting:contributor","color":"b60205","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nunit/nunit/pulls/3000/commits","review_comments_url":"https://api.github.com/repos/nunit/nunit/pulls/3000/comments","review_comment_url":"https://api.github.com/repos/nunit/nunit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nunit/nunit/issues/3000/comments","statuses_url":"https://api.github.com/repos/nunit/nunit/statuses/633593f40d00295d99f4d6a7838747ecd6302d01","head":{"label":"DaiMichael:issue-2994","ref":"issue-2994","sha":"633593f40d00295d99f4d6a7838747ecd6302d01","user":{"login":"DaiMichael","id":16304575,"node_id":"MDQ6VXNlcjE2MzA0NTc1","avatar_url":"https://avatars2.githubusercontent.com/u/16304575?v=4","gravatar_id":"","url":"https://api.github.com/users/DaiMichael","html_url":"https://github.com/DaiMichael","followers_url":"https://api.github.com/users/DaiMichael/followers","following_url":"https://api.github.com/users/DaiMichael/following{/other_user}","gists_url":"https://api.github.com/users/DaiMichael/gists{/gist_id}","starred_url":"https://api.github.com/users/DaiMichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaiMichael/subscriptions","organizations_url":"https://api.github.com/users/DaiMichael/orgs","repos_url":"https://api.github.com/users/DaiMichael/repos","events_url":"https://api.github.com/users/DaiMichael/events{/privacy}","received_events_url":"https://api.github.com/users/DaiMichael/received_events","type":"User","site_admin":false},"repo":{"id":128816089,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MTYwODk=","name":"nunit","full_name":"DaiMichael/nunit","private":false,"owner":{"login":"DaiMichael","id":16304575,"node_id":"MDQ6VXNlcjE2MzA0NTc1","avatar_url":"https://avatars2.githubusercontent.com/u/16304575?v=4","gravatar_id":"","url":"https://api.github.com/users/DaiMichael","html_url":"https://github.com/DaiMichael","followers_url":"https://api.github.com/users/DaiMichael/followers","following_url":"https://api.github.com/users/DaiMichael/following{/other_user}","gists_url":"https://api.github.com/users/DaiMichael/gists{/gist_id}","starred_url":"https://api.github.com/users/DaiMichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaiMichael/subscriptions","organizations_url":"https://api.github.com/users/DaiMichael/orgs","repos_url":"https://api.github.com/users/DaiMichael/repos","events_url":"https://api.github.com/users/DaiMichael/events{/privacy}","received_events_url":"https://api.github.com/users/DaiMichael/received_events","type":"User","site_admin":false},"html_url":"https://github.com/DaiMichael/nunit","description":"NUnit 3.0 Framework","fork":true,"url":"https://api.github.com/repos/DaiMichael/nunit","forks_url":"https://api.github.com/repos/DaiMichael/nunit/forks","keys_url":"https://api.github.com/repos/DaiMichael/nunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DaiMichael/nunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DaiMichael/nunit/teams","hooks_url":"https://api.github.com/repos/DaiMichael/nunit/hooks","issue_events_url":"https://api.github.com/repos/DaiMichael/nunit/issues/events{/number}","events_url":"https://api.github.com/repos/DaiMichael/nunit/events","assignees_url":"https://api.github.com/repos/DaiMichael/nunit/assignees{/user}","branches_url":"https://api.github.com/repos/DaiMichael/nunit/branches{/branch}","tags_url":"https://api.github.com/repos/DaiMichael/nunit/tags","blobs_url":"https://api.github.com/repos/DaiMichael/nunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DaiMichael/nunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DaiMichael/nunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/DaiMichael/nunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DaiMichael/nunit/statuses/{sha}","languages_url":"https://api.github.com/repos/DaiMichael/nunit/languages","stargazers_url":"https://api.github.com/repos/DaiMichael/nunit/stargazers","contributors_url":"https://api.github.com/repos/DaiMichael/nunit/contributors","subscribers_url":"https://api.github.com/repos/DaiMichael/nunit/subscribers","subscription_url":"https://api.github.com/repos/DaiMichael/nunit/subscription","commits_url":"https://api.github.com/repos/DaiMichael/nunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/DaiMichael/nunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/DaiMichael/nunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/DaiMichael/nunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/DaiMichael/nunit/contents/{+path}","compare_url":"https://api.github.com/repos/DaiMichael/nunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DaiMichael/nunit/merges","archive_url":"https://api.github.com/repos/DaiMichael/nunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DaiMichael/nunit/downloads","issues_url":"https://api.github.com/repos/DaiMichael/nunit/issues{/number}","pulls_url":"https://api.github.com/repos/DaiMichael/nunit/pulls{/number}","milestones_url":"https://api.github.com/repos/DaiMichael/nunit/milestones{/number}","notifications_url":"https://api.github.com/repos/DaiMichael/nunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DaiMichael/nunit/labels{/name}","releases_url":"https://api.github.com/repos/DaiMichael/nunit/releases{/id}","deployments_url":"https://api.github.com/repos/DaiMichael/nunit/deployments","created_at":"2018-04-09T18:24:56Z","updated_at":"2018-08-29T20:40:16Z","pushed_at":"2018-09-16T12:12:34Z","git_url":"git://github.com/DaiMichael/nunit.git","ssh_url":"git@github.com:DaiMichael/nunit.git","clone_url":"https://github.com/DaiMichael/nunit.git","svn_url":"https://github.com/DaiMichael/nunit","homepage":"http://www.nunit.org/","size":34704,"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,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nunit:master","ref":"master","sha":"f4db05b271d6e42c77b4d4f5d842869663b2339a","user":{"login":"nunit","id":2678858,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Nzg4NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2678858?v=4","gravatar_id":"","url":"https://api.github.com/users/nunit","html_url":"https://github.com/nunit","followers_url":"https://api.github.com/users/nunit/followers","following_url":"https://api.github.com/users/nunit/following{/other_user}","gists_url":"https://api.github.com/users/nunit/gists{/gist_id}","starred_url":"https://api.github.com/users/nunit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nunit/subscriptions","organizations_url":"https://api.github.com/users/nunit/orgs","repos_url":"https://api.github.com/users/nunit/repos","events_url":"https://api.github.com/users/nunit/events{/privacy}","received_events_url":"https://api.github.com/users/nunit/received_events","type":"Organization","site_admin":false},"repo":{"id":13692183,"node_id":"MDEwOlJlcG9zaXRvcnkxMzY5MjE4Mw==","name":"nunit","full_name":"nunit/nunit","private":false,"owner":{"login":"nunit","id":2678858,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Nzg4NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/2678858?v=4","gravatar_id":"","url":"https://api.github.com/users/nunit","html_url":"https://github.com/nunit","followers_url":"https://api.github.com/users/nunit/followers","following_url":"https://api.github.com/users/nunit/following{/other_user}","gists_url":"https://api.github.com/users/nunit/gists{/gist_id}","starred_url":"https://api.github.com/users/nunit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nunit/subscriptions","organizations_url":"https://api.github.com/users/nunit/orgs","repos_url":"https://api.github.com/users/nunit/repos","events_url":"https://api.github.com/users/nunit/events{/privacy}","received_events_url":"https://api.github.com/users/nunit/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/nunit/nunit","description":"NUnit 3.0 Framework","fork":false,"url":"https://api.github.com/repos/nunit/nunit","forks_url":"https://api.github.com/repos/nunit/nunit/forks","keys_url":"https://api.github.com/repos/nunit/nunit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nunit/nunit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nunit/nunit/teams","hooks_url":"https://api.github.com/repos/nunit/nunit/hooks","issue_events_url":"https://api.github.com/repos/nunit/nunit/issues/events{/number}","events_url":"https://api.github.com/repos/nunit/nunit/events","assignees_url":"https://api.github.com/repos/nunit/nunit/assignees{/user}","branches_url":"https://api.github.com/repos/nunit/nunit/branches{/branch}","tags_url":"https://api.github.com/repos/nunit/nunit/tags","blobs_url":"https://api.github.com/repos/nunit/nunit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nunit/nunit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nunit/nunit/git/refs{/sha}","trees_url":"https://api.github.com/repos/nunit/nunit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nunit/nunit/statuses/{sha}","languages_url":"https://api.github.com/repos/nunit/nunit/languages","stargazers_url":"https://api.github.com/repos/nunit/nunit/stargazers","contributors_url":"https://api.github.com/repos/nunit/nunit/contributors","subscribers_url":"https://api.github.com/repos/nunit/nunit/subscribers","subscription_url":"https://api.github.com/repos/nunit/nunit/subscription","commits_url":"https://api.github.com/repos/nunit/nunit/commits{/sha}","git_commits_url":"https://api.github.com/repos/nunit/nunit/git/commits{/sha}","comments_url":"https://api.github.com/repos/nunit/nunit/comments{/number}","issue_comment_url":"https://api.github.com/repos/nunit/nunit/issues/comments{/number}","contents_url":"https://api.github.com/repos/nunit/nunit/contents/{+path}","compare_url":"https://api.github.com/repos/nunit/nunit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nunit/nunit/merges","archive_url":"https://api.github.com/repos/nunit/nunit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nunit/nunit/downloads","issues_url":"https://api.github.com/repos/nunit/nunit/issues{/number}","pulls_url":"https://api.github.com/repos/nunit/nunit/pulls{/number}","milestones_url":"https://api.github.com/repos/nunit/nunit/milestones{/number}","notifications_url":"https://api.github.com/repos/nunit/nunit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nunit/nunit/labels{/name}","releases_url":"https://api.github.com/repos/nunit/nunit/releases{/id}","deployments_url":"https://api.github.com/repos/nunit/nunit/deployments","created_at":"2013-10-18T23:43:29Z","updated_at":"2018-09-17T22:57:53Z","pushed_at":"2018-09-17T00:16:40Z","git_url":"git://github.com/nunit/nunit.git","ssh_url":"git@github.com:nunit/nunit.git","clone_url":"https://github.com/nunit/nunit.git","svn_url":"https://github.com/nunit/nunit","homepage":"http://www.nunit.org/","size":34767,"stargazers_count":1427,"watchers_count":1427,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":514,"mirror_url":null,"archived":false,"open_issues_count":317,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":514,"open_issues":317,"watchers":1427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nunit/nunit/pulls/3000"},"html":{"href":"https://github.com/nunit/nunit/pull/3000"},"issue":{"href":"https://api.github.com/repos/nunit/nunit/issues/3000"},"comments":{"href":"https://api.github.com/repos/nunit/nunit/issues/3000/comments"},"review_comments":{"href":"https://api.github.com/repos/nunit/nunit/pulls/3000/comments"},"review_comment":{"href":"https://api.github.com/repos/nunit/nunit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nunit/nunit/pulls/3000/commits"},"statuses":{"href":"https://api.github.com/repos/nunit/nunit/statuses/633593f40d00295d99f4d6a7838747ecd6302d01"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jnm2"}}