{"action":"created","comment":{"url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/comments/223095900","pull_request_review_id":162147922,"id":223095900,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzA5NTkwMA==","diff_hunk":"@@ -15,20 +15,21 @@ public static class ListManagerTests\n         private static readonly string TestListName = \"testname\";\n         private static readonly string TestListItem = \"item\";\n         private static readonly ulong userId = 10;\n+        private static readonly ListManager listManager = InversionOfControl.Container.GetInstance<ListManager>();","path":"CommunityBot.NUnit.Tests/FeatureTests/ListManagerTests.cs","position":4,"original_position":4,"commit_id":"8eddde593f9ed71309c70c293395a9d97e117d00","original_commit_id":"8eddde593f9ed71309c70c293395a9d97e117d00","user":{"login":"petrspelos","id":21304428,"node_id":"MDQ6VXNlcjIxMzA0NDI4","avatar_url":"https://avatars3.githubusercontent.com/u/21304428?v=4","gravatar_id":"","url":"https://api.github.com/users/petrspelos","html_url":"https://github.com/petrspelos","followers_url":"https://api.github.com/users/petrspelos/followers","following_url":"https://api.github.com/users/petrspelos/following{/other_user}","gists_url":"https://api.github.com/users/petrspelos/gists{/gist_id}","starred_url":"https://api.github.com/users/petrspelos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petrspelos/subscriptions","organizations_url":"https://api.github.com/users/petrspelos/orgs","repos_url":"https://api.github.com/users/petrspelos/repos","events_url":"https://api.github.com/users/petrspelos/events{/privacy}","received_events_url":"https://api.github.com/users/petrspelos/received_events","type":"User","site_admin":false},"body":"Do not use InversionOfControl in unit tests. Initialize the concrete types as you need.\r\nInitialize this property in a \r\n```cs\r\n[OneTimeSetUp]\r\npublic void SetupTestResources()\r\n{\r\n    listManager = new ListManager();\r\n}\r\n```\r\nif it requires other classes, new them up too.\r\n\r\n**Why are we doing this?**\r\nBecause for example JsonDataStorage is not ideal for unit tests, since it creates files and therefore, one execution of a unit test can affect others. We don't want that. So perhaps there's a InMemoryDataStorage that also implements the IDataStorage interface that you can use in these unit tests.\r\n\r\nThat's what we have Dependency Injection for.","created_at":"2018-10-05T18:11:26Z","updated_at":"2018-10-05T18:36:27Z","html_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122#discussion_r223095900","pull_request_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/comments/223095900"},"html":{"href":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122#discussion_r223095900"},"pull_request":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122","id":220763551,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwNzYzNTUx","html_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122","diff_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122.diff","patch_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122.patch","issue_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/122","number":122,"state":"open","locked":false,"title":"Dependency Injection for ListManager class","user":{"login":"M4N1","id":33767190,"node_id":"MDQ6VXNlcjMzNzY3MTkw","avatar_url":"https://avatars3.githubusercontent.com/u/33767190?v=4","gravatar_id":"","url":"https://api.github.com/users/M4N1","html_url":"https://github.com/M4N1","followers_url":"https://api.github.com/users/M4N1/followers","following_url":"https://api.github.com/users/M4N1/following{/other_user}","gists_url":"https://api.github.com/users/M4N1/gists{/gist_id}","starred_url":"https://api.github.com/users/M4N1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M4N1/subscriptions","organizations_url":"https://api.github.com/users/M4N1/orgs","repos_url":"https://api.github.com/users/M4N1/repos","events_url":"https://api.github.com/users/M4N1/events{/privacy}","received_events_url":"https://api.github.com/users/M4N1/received_events","type":"User","site_admin":false},"body":"## Related issue\r\n[Refactor] Convert global accounts into services #112\r\n\r\n## Changes\r\nCreating IDataStorage interface to allow dependency injection for the storage solution.\r\nImplementing the IDataStorage into ListManager class.\r\nFixing error in the ListManager class.","created_at":"2018-10-05T16:52:12Z","updated_at":"2018-10-05T18:36:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5d36d5bb602470031ce728e37d78862143875b8a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122/commits","review_comments_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122/comments","review_comment_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/122/comments","statuses_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/statuses/8eddde593f9ed71309c70c293395a9d97e117d00","head":{"label":"M4N1:master","ref":"master","sha":"8eddde593f9ed71309c70c293395a9d97e117d00","user":{"login":"M4N1","id":33767190,"node_id":"MDQ6VXNlcjMzNzY3MTkw","avatar_url":"https://avatars3.githubusercontent.com/u/33767190?v=4","gravatar_id":"","url":"https://api.github.com/users/M4N1","html_url":"https://github.com/M4N1","followers_url":"https://api.github.com/users/M4N1/followers","following_url":"https://api.github.com/users/M4N1/following{/other_user}","gists_url":"https://api.github.com/users/M4N1/gists{/gist_id}","starred_url":"https://api.github.com/users/M4N1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M4N1/subscriptions","organizations_url":"https://api.github.com/users/M4N1/orgs","repos_url":"https://api.github.com/users/M4N1/repos","events_url":"https://api.github.com/users/M4N1/events{/privacy}","received_events_url":"https://api.github.com/users/M4N1/received_events","type":"User","site_admin":false},"repo":{"id":151729054,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE3MjkwNTQ=","name":"Community-Discord-BOT","full_name":"M4N1/Community-Discord-BOT","private":false,"owner":{"login":"M4N1","id":33767190,"node_id":"MDQ6VXNlcjMzNzY3MTkw","avatar_url":"https://avatars3.githubusercontent.com/u/33767190?v=4","gravatar_id":"","url":"https://api.github.com/users/M4N1","html_url":"https://github.com/M4N1","followers_url":"https://api.github.com/users/M4N1/followers","following_url":"https://api.github.com/users/M4N1/following{/other_user}","gists_url":"https://api.github.com/users/M4N1/gists{/gist_id}","starred_url":"https://api.github.com/users/M4N1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/M4N1/subscriptions","organizations_url":"https://api.github.com/users/M4N1/orgs","repos_url":"https://api.github.com/users/M4N1/repos","events_url":"https://api.github.com/users/M4N1/events{/privacy}","received_events_url":"https://api.github.com/users/M4N1/received_events","type":"User","site_admin":false},"html_url":"https://github.com/M4N1/Community-Discord-BOT","description":"A community driven public Discord-BOT using C# and Discord .NET, feel free to contribute!","fork":true,"url":"https://api.github.com/repos/M4N1/Community-Discord-BOT","forks_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/forks","keys_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/teams","hooks_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/hooks","issue_events_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/issues/events{/number}","events_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/events","assignees_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/assignees{/user}","branches_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/branches{/branch}","tags_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/tags","blobs_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/statuses/{sha}","languages_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/languages","stargazers_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/stargazers","contributors_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/contributors","subscribers_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/subscribers","subscription_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/subscription","commits_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/contents/{+path}","compare_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/merges","archive_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/downloads","issues_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/issues{/number}","pulls_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/pulls{/number}","milestones_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/milestones{/number}","notifications_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/labels{/name}","releases_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/releases{/id}","deployments_url":"https://api.github.com/repos/M4N1/Community-Discord-BOT/deployments","created_at":"2018-10-05T13:59:46Z","updated_at":"2018-10-05T16:57:36Z","pushed_at":"2018-10-05T16:57:46Z","git_url":"git://github.com/M4N1/Community-Discord-BOT.git","ssh_url":"git@github.com:M4N1/Community-Discord-BOT.git","clone_url":"https://github.com/M4N1/Community-Discord-BOT.git","svn_url":"https://github.com/M4N1/Community-Discord-BOT","homepage":null,"size":441,"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":"discord-bot-tutorial:master","ref":"master","sha":"5ac3d23d3631cf9f2472d56aca1c2b3c34fedc2d","user":{"login":"discord-bot-tutorial","id":43266925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjY2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/43266925?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-bot-tutorial","html_url":"https://github.com/discord-bot-tutorial","followers_url":"https://api.github.com/users/discord-bot-tutorial/followers","following_url":"https://api.github.com/users/discord-bot-tutorial/following{/other_user}","gists_url":"https://api.github.com/users/discord-bot-tutorial/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-bot-tutorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-bot-tutorial/subscriptions","organizations_url":"https://api.github.com/users/discord-bot-tutorial/orgs","repos_url":"https://api.github.com/users/discord-bot-tutorial/repos","events_url":"https://api.github.com/users/discord-bot-tutorial/events{/privacy}","received_events_url":"https://api.github.com/users/discord-bot-tutorial/received_events","type":"Organization","site_admin":false},"repo":{"id":120888203,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA4ODgyMDM=","name":"Community-Discord-BOT","full_name":"discord-bot-tutorial/Community-Discord-BOT","private":false,"owner":{"login":"discord-bot-tutorial","id":43266925,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzMjY2OTI1","avatar_url":"https://avatars2.githubusercontent.com/u/43266925?v=4","gravatar_id":"","url":"https://api.github.com/users/discord-bot-tutorial","html_url":"https://github.com/discord-bot-tutorial","followers_url":"https://api.github.com/users/discord-bot-tutorial/followers","following_url":"https://api.github.com/users/discord-bot-tutorial/following{/other_user}","gists_url":"https://api.github.com/users/discord-bot-tutorial/gists{/gist_id}","starred_url":"https://api.github.com/users/discord-bot-tutorial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/discord-bot-tutorial/subscriptions","organizations_url":"https://api.github.com/users/discord-bot-tutorial/orgs","repos_url":"https://api.github.com/users/discord-bot-tutorial/repos","events_url":"https://api.github.com/users/discord-bot-tutorial/events{/privacy}","received_events_url":"https://api.github.com/users/discord-bot-tutorial/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT","description":"A community driven public Discord-BOT using C# and Discord .NET, feel free to contribute!","fork":false,"url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT","forks_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/forks","keys_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/teams","hooks_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/hooks","issue_events_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/events{/number}","events_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/events","assignees_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/assignees{/user}","branches_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/branches{/branch}","tags_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/tags","blobs_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/statuses/{sha}","languages_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/languages","stargazers_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/stargazers","contributors_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/contributors","subscribers_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/subscribers","subscription_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/subscription","commits_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/contents/{+path}","compare_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/merges","archive_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/downloads","issues_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues{/number}","pulls_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls{/number}","milestones_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/milestones{/number}","notifications_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/labels{/name}","releases_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/releases{/id}","deployments_url":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/deployments","created_at":"2018-02-09T09:53:04Z","updated_at":"2018-10-05T12:48:24Z","pushed_at":"2018-10-05T16:57:47Z","git_url":"git://github.com/discord-bot-tutorial/Community-Discord-BOT.git","ssh_url":"git@github.com:discord-bot-tutorial/Community-Discord-BOT.git","clone_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT.git","svn_url":"https://github.com/discord-bot-tutorial/Community-Discord-BOT","homepage":null,"size":425,"stargazers_count":13,"watchers_count":13,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":30,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":30,"open_issues":25,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122"},"html":{"href":"https://github.com/discord-bot-tutorial/Community-Discord-BOT/pull/122"},"issue":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/122"},"comments":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/discord-bot-tutorial/Community-Discord-BOT/statuses/8eddde593f9ed71309c70c293395a9d97e117d00"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"petrspelos"}}