payload: {"action":"created","comment":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments/280254695","pull_request_review_id":232802668,"id":280254695,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI4MDI1NDY5NQ==","diff_hunk":"@@ -0,0 +1,24 @@\n+﻿// Copyright (c) Microsoft Corporation. All rights reserved.\n+// Licensed under the MIT License.\n+\n+using System;\n+using Castle.DynamicProxy;\n+\n+namespace Azure.Core.Tests\n+{\n+    /// <summary>\n+    /// Ensures that tests sticks to calling only async methods\n+    /// </summary>\n+    public class AvoidSyncInterceptor : IInterceptor\n+    {\n+        public void Intercept(IInvocation invocation)\n+        {\n+            if (!invocation.Method.Name.EndsWith(\"Async\"))\n+            {\n+                throw new InvalidOperationException(\"Async method call expected\");","path":"src/SDKs/Azure.Core/data-plane/Azure.Core.Tests/AvoidSyncInterceptor.cs","position":18,"original_position":18,"commit_id":"fb22bb9ef39865693a5be3a36c93db771934fd14","original_commit_id":"fb22bb9ef39865693a5be3a36c93db771934fd14","user":{"login":"tg-msft","id":1179329,"node_id":"MDQ6VXNlcjExNzkzMjk=","avatar_url":"https://avatars0.githubusercontent.com/u/1179329?v=4","gravatar_id":"","url":"https://api.github.com/users/tg-msft","html_url":"https://github.com/tg-msft","followers_url":"https://api.github.com/users/tg-msft/followers","following_url":"https://api.github.com/users/tg-msft/following{/other_user}","gists_url":"https://api.github.com/users/tg-msft/gists{/gist_id}","starred_url":"https://api.github.com/users/tg-msft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tg-msft/subscriptions","organizations_url":"https://api.github.com/users/tg-msft/orgs","repos_url":"https://api.github.com/users/tg-msft/repos","events_url":"https://api.github.com/users/tg-msft/events{/privacy}","received_events_url":"https://api.github.com/users/tg-msft/received_events","type":"User","site_admin":false},"body":"Wait, won't this fail for things like GetFooClient()?  Should we also make sure there's a similarly named method with an Async suffix before we throw?","created_at":"2019-05-01T23:42:57Z","updated_at":"2019-05-01T23:42:57Z","html_url":"https://github.com/Azure/azure-sdk-for-net/pull/6028#discussion_r280254695","pull_request_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments/280254695"},"html":{"href":"https://github.com/Azure/azure-sdk-for-net/pull/6028#discussion_r280254695"},"pull_request":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028","id":275127076,"node_id":"MDExOlB1bGxSZXF1ZXN0Mjc1MTI3MDc2","html_url":"https://github.com/Azure/azure-sdk-for-net/pull/6028","diff_url":"https://github.com/Azure/azure-sdk-for-net/pull/6028.diff","patch_url":"https://github.com/Azure/azure-sdk-for-net/pull/6028.patch","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/6028","number":6028,"state":"open","locked":false,"title":"Add sync client test infrastructure","user":{"login":"pakrym","id":1697911,"node_id":"MDQ6VXNlcjE2OTc5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"body":"The idea here is to avoid duplicating tests to hit both sync and async code paths.\r\n\r\nThe way it's accomplished is the following:\r\n\r\n1. Client test classes inherit from `ClientTestBase` class that requires them to have a ctor with `isAsync` parameter.\r\n2. Client tests use WrapClient or CreateClient base methods to create an instance of the client used in tests.\r\n3. Tests are written using async client methods.\r\n4. Depending on the mode of the tests (async vs sync) async calls get redirected to sync calls transparently allowing us to have coverage for both while avoiding code duplication.\r\n\r\nFixes: https://github.com/Azure/azure-sdk-for-net/issues/6020\r\n","created_at":"2019-05-01T19:19:10Z","updated_at":"2019-05-01T23:42:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c2e11404da54ec5b978c219052fe1be42ad8fab","assignee":null,"assignees":[],"requested_reviewers":[{"login":"KrzysztofCwalina","id":9724236,"node_id":"MDQ6VXNlcjk3MjQyMzY=","avatar_url":"https://avatars0.githubusercontent.com/u/9724236?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false},{"login":"maririos","id":9868623,"node_id":"MDQ6VXNlcjk4Njg2MjM=","avatar_url":"https://avatars0.githubusercontent.com/u/9868623?v=4","gravatar_id":"","url":"https://api.github.com/users/maririos","html_url":"https://github.com/maririos","followers_url":"https://api.github.com/users/maririos/followers","following_url":"https://api.github.com/users/maririos/following{/other_user}","gists_url":"https://api.github.com/users/maririos/gists{/gist_id}","starred_url":"https://api.github.com/users/maririos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maririos/subscriptions","organizations_url":"https://api.github.com/users/maririos/orgs","repos_url":"https://api.github.com/users/maririos/repos","events_url":"https://api.github.com/users/maririos/events{/privacy}","received_events_url":"https://api.github.com/users/maririos/received_events","type":"User","site_admin":false},{"login":"schaabs","id":11322348,"node_id":"MDQ6VXNlcjExMzIyMzQ4","avatar_url":"https://avatars1.githubusercontent.com/u/11322348?v=4","gravatar_id":"","url":"https://api.github.com/users/schaabs","html_url":"https://github.com/schaabs","followers_url":"https://api.github.com/users/schaabs/followers","following_url":"https://api.github.com/users/schaabs/following{/other_user}","gists_url":"https://api.github.com/users/schaabs/gists{/gist_id}","starred_url":"https://api.github.com/users/schaabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schaabs/subscriptions","organizations_url":"https://api.github.com/users/schaabs/orgs","repos_url":"https://api.github.com/users/schaabs/repos","events_url":"https://api.github.com/users/schaabs/events{/privacy}","received_events_url":"https://api.github.com/users/schaabs/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028/commits","review_comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028/comments","review_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/6028/comments","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/fb22bb9ef39865693a5be3a36c93db771934fd14","head":{"label":"pakrym:pakrym/add-sync-client-test-inf","ref":"pakrym/add-sync-client-test-inf","sha":"fb22bb9ef39865693a5be3a36c93db771934fd14","user":{"login":"pakrym","id":1697911,"node_id":"MDQ6VXNlcjE2OTc5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"repo":{"id":176317692,"node_id":"MDEwOlJlcG9zaXRvcnkxNzYzMTc2OTI=","name":"azure-sdk-for-net","full_name":"pakrym/azure-sdk-for-net","private":false,"owner":{"login":"pakrym","id":1697911,"node_id":"MDQ6VXNlcjE2OTc5MTE=","avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"html_url":"https://github.com/pakrym/azure-sdk-for-net","description":".NET Libraries for Azure","fork":true,"url":"https://api.github.com/repos/pakrym/azure-sdk-for-net","forks_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/forks","keys_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/teams","hooks_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/hooks","issue_events_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/issues/events{/number}","events_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/events","assignees_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/assignees{/user}","branches_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/branches{/branch}","tags_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/tags","blobs_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/git/refs{/sha}","trees_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/statuses/{sha}","languages_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/languages","stargazers_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/stargazers","contributors_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/contributors","subscribers_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/subscribers","subscription_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/subscription","commits_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/commits{/sha}","git_commits_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/git/commits{/sha}","comments_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/comments{/number}","issue_comment_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/issues/comments{/number}","contents_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/contents/{+path}","compare_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/merges","archive_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/downloads","issues_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/issues{/number}","pulls_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/pulls{/number}","milestones_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/milestones{/number}","notifications_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/labels{/name}","releases_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/releases{/id}","deployments_url":"https://api.github.com/repos/pakrym/azure-sdk-for-net/deployments","created_at":"2019-03-18T15:40:09Z","updated_at":"2019-04-08T22:36:39Z","pushed_at":"2019-05-01T23:29:51Z","git_url":"git://github.com/pakrym/azure-sdk-for-net.git","ssh_url":"git@github.com:pakrym/azure-sdk-for-net.git","clone_url":"https://github.com/pakrym/azure-sdk-for-net.git","svn_url":"https://github.com/pakrym/azure-sdk-for-net","homepage":"https://docs.microsoft.com/en-us/dotnet/azure/","size":285842,"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,"disabled":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":"Azure:master","ref":"master","sha":"3fa4f04a4bb40ae9e0540d926a96a0b769bbf261","user":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":2928944,"node_id":"MDEwOlJlcG9zaXRvcnkyOTI4OTQ0","name":"azure-sdk-for-net","full_name":"Azure/azure-sdk-for-net","private":false,"owner":{"login":"Azure","id":6844498,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY4NDQ0OTg=","avatar_url":"https://avatars0.githubusercontent.com/u/6844498?v=4","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Azure/azure-sdk-for-net","description":".NET Libraries for Azure","fork":false,"url":"https://api.github.com/repos/Azure/azure-sdk-for-net","forks_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/forks","keys_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/teams","hooks_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/hooks","issue_events_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/events","assignees_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/tags","blobs_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/languages","stargazers_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/stargazers","contributors_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/contributors","subscribers_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/subscribers","subscription_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/subscription","commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/merges","archive_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/downloads","issues_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/labels{/name}","releases_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/azure-sdk-for-net/deployments","created_at":"2011-12-06T23:32:47Z","updated_at":"2019-05-01T23:09:54Z","pushed_at":"2019-05-01T23:41:51Z","git_url":"git://github.com/Azure/azure-sdk-for-net.git","ssh_url":"git@github.com:Azure/azure-sdk-for-net.git","clone_url":"https://github.com/Azure/azure-sdk-for-net.git","svn_url":"https://github.com/Azure/azure-sdk-for-net","homepage":"https://docs.microsoft.com/en-us/dotnet/azure/","size":290022,"stargazers_count":1334,"watchers_count":1334,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1361,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":471,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":1361,"open_issues":471,"watchers":1334,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028"},"html":{"href":"https://github.com/Azure/azure-sdk-for-net/pull/6028"},"issue":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/6028"},"comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/issues/6028/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/pulls/6028/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/azure-sdk-for-net/statuses/fb22bb9ef39865693a5be3a36c93db771934fd14"}},"author_association":"CONTRIBUTOR"}}
other: {"actor":{"display_login":"tg-msft"}}