{"action":"created","comment":{"url":"https://api.github.com/repos/aspnet/MusicStore/pulls/comments/25580277","id":25580277,"diff_hunk":"@@ -0,0 +1,116 @@\n+﻿using System;\n+using System.Collections.Generic;\n+using System.Security.Claims;\n+using System.Threading.Tasks;\n+using Microsoft.AspNet.Hosting;\n+using Microsoft.AspNet.Http;\n+using Microsoft.AspNet.Http.Core;\n+using Microsoft.AspNet.Http.Core.Security;\n+using Microsoft.AspNet.Http.Security;\n+using Microsoft.AspNet.Identity;\n+using Microsoft.AspNet.Mvc;\n+using Microsoft.AspNet.Routing;\n+using Microsoft.Framework.DependencyInjection;\n+using Microsoft.Framework.DependencyInjection.Fallback;\n+using Xunit;\n+using MusicStore.Models;\n+\n+namespace MusicStore.Controllers\n+{\n+    public class ManageControllerTest\n+    {\n+        private readonly IServiceProvider _serviceProvider;\n+\n+        public ManageControllerTest()\n+        {\n+            var services = new ServiceCollection();\n+            services.AddEntityFramework()\n+                    .AddInMemoryStore()\n+                    .AddDbContext<MusicStoreContext>();\n+\n+            services.AddIdentity<ApplicationUser, IdentityRole>()\n+                    .AddEntityFrameworkStores<MusicStoreContext>();\n+\n+            // IHttpContextAccessor is required for SignInManager, and UserManager\n+            services.AddInstance<IHttpContextAccessor>(new TestHttpContextAcccessor());\n+\n+            _serviceProvider = services.BuildServiceProvider();\n+        }\n+\n+        [Fact]\n+        public async Task Index_ReturnsViewBagMessagesExpected()\n+        {\n+            // Arrange\n+            var userId = \"TestUserA\";\n+            var phone = \"abcdefg\";\n+            var claims = new List<Claim> { new Claim(ClaimTypes.NameIdentifier, userId) };\n+\n+            var userManager = _serviceProvider.GetRequiredService<UserManager<ApplicationUser>>();\n+            var userManagerResult = await userManager.CreateAsync(\n+                new ApplicationUser { Id = userId, UserName = \"Test\", TwoFactorEnabled = true, PhoneNumber = phone },\n+                \"Pass@word1\");\n+            Assert.True(userManagerResult.Succeeded);\n+\n+            var signInManager = _serviceProvider.GetRequiredService<SignInManager<ApplicationUser>>();","path":"test/MusicStore.Test/ManageControllerTest.cs","position":54,"original_position":54,"commit_id":"72e6c9e6cea0f9751792dc99406c0c94f432f3c8","original_commit_id":"72e6c9e6cea0f9751792dc99406c0c94f432f3c8","user":{"login":"ianhong","id":2746184,"avatar_url":"https://avatars.githubusercontent.com/u/2746184?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhong","html_url":"https://github.com/ianhong","followers_url":"https://api.github.com/users/ianhong/followers","following_url":"https://api.github.com/users/ianhong/following{/other_user}","gists_url":"https://api.github.com/users/ianhong/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhong/subscriptions","organizations_url":"https://api.github.com/users/ianhong/orgs","repos_url":"https://api.github.com/users/ianhong/repos","events_url":"https://api.github.com/users/ianhong/events{/privacy}","received_events_url":"https://api.github.com/users/ianhong/received_events","type":"User","site_admin":false},"body":"@HaoK \r\nBased on your comments, I think UserManager should look fine. How about SignInManager? Can this be a recommended way to use in the unit test scenario? Is there any better way? ","created_at":"2015-03-02T06:31:37Z","updated_at":"2015-03-02T06:31:37Z","html_url":"https://github.com/aspnet/MusicStore/pull/407#discussion_r25580277","pull_request_url":"https://api.github.com/repos/aspnet/MusicStore/pulls/407","_links":{"self":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/comments/25580277"},"html":{"href":"https://github.com/aspnet/MusicStore/pull/407#discussion_r25580277"},"pull_request":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/407"}}},"pull_request":{"url":"https://api.github.com/repos/aspnet/MusicStore/pulls/407","id":30207541,"html_url":"https://github.com/aspnet/MusicStore/pull/407","diff_url":"https://github.com/aspnet/MusicStore/pull/407.diff","patch_url":"https://github.com/aspnet/MusicStore/pull/407.patch","issue_url":"https://api.github.com/repos/aspnet/MusicStore/issues/407","number":407,"state":"open","locked":false,"title":"Adding a MusicStore unit test for for SignInManager and UserManager","user":{"login":"ianhong","id":2746184,"avatar_url":"https://avatars.githubusercontent.com/u/2746184?v=3","gravatar_id":"","url":"https://api.github.com/users/ianhong","html_url":"https://github.com/ianhong","followers_url":"https://api.github.com/users/ianhong/followers","following_url":"https://api.github.com/users/ianhong/following{/other_user}","gists_url":"https://api.github.com/users/ianhong/gists{/gist_id}","starred_url":"https://api.github.com/users/ianhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianhong/subscriptions","organizations_url":"https://api.github.com/users/ianhong/orgs","repos_url":"https://api.github.com/users/ianhong/repos","events_url":"https://api.github.com/users/ianhong/events{/privacy}","received_events_url":"https://api.github.com/users/ianhong/received_events","type":"User","site_admin":false},"body":"@rynowak , @Praburaj , @Eilon , and @HaoK \r\n\r\nCould you please review this PR?? ","created_at":"2015-02-27T22:39:28Z","updated_at":"2015-03-02T06:31:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cd5e7c36d12d702a9a20d887cff6a57e6245aef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aspnet/MusicStore/pulls/407/commits","review_comments_url":"https://api.github.com/repos/aspnet/MusicStore/pulls/407/comments","review_comment_url":"https://api.github.com/repos/aspnet/MusicStore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aspnet/MusicStore/issues/407/comments","statuses_url":"https://api.github.com/repos/aspnet/MusicStore/statuses/72e6c9e6cea0f9751792dc99406c0c94f432f3c8","head":{"label":"aspnet:addunittest_2","ref":"addunittest_2","sha":"72e6c9e6cea0f9751792dc99406c0c94f432f3c8","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":16301196,"name":"MusicStore","full_name":"aspnet/MusicStore","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/MusicStore","description":"Sample MusicStore application that uses MVC and Entity Framework.","fork":false,"url":"https://api.github.com/repos/aspnet/MusicStore","forks_url":"https://api.github.com/repos/aspnet/MusicStore/forks","keys_url":"https://api.github.com/repos/aspnet/MusicStore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/MusicStore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/MusicStore/teams","hooks_url":"https://api.github.com/repos/aspnet/MusicStore/hooks","issue_events_url":"https://api.github.com/repos/aspnet/MusicStore/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/MusicStore/events","assignees_url":"https://api.github.com/repos/aspnet/MusicStore/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/MusicStore/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/MusicStore/tags","blobs_url":"https://api.github.com/repos/aspnet/MusicStore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/MusicStore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/MusicStore/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/MusicStore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/MusicStore/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/MusicStore/languages","stargazers_url":"https://api.github.com/repos/aspnet/MusicStore/stargazers","contributors_url":"https://api.github.com/repos/aspnet/MusicStore/contributors","subscribers_url":"https://api.github.com/repos/aspnet/MusicStore/subscribers","subscription_url":"https://api.github.com/repos/aspnet/MusicStore/subscription","commits_url":"https://api.github.com/repos/aspnet/MusicStore/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/MusicStore/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/MusicStore/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/MusicStore/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/MusicStore/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/MusicStore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/MusicStore/merges","archive_url":"https://api.github.com/repos/aspnet/MusicStore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/MusicStore/downloads","issues_url":"https://api.github.com/repos/aspnet/MusicStore/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/MusicStore/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/MusicStore/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/MusicStore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/MusicStore/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/MusicStore/releases{/id}","created_at":"2014-01-28T03:35:13Z","updated_at":"2015-02-27T17:31:09Z","pushed_at":"2015-03-02T06:26:50Z","git_url":"git://github.com/aspnet/MusicStore.git","ssh_url":"git@github.com:aspnet/MusicStore.git","clone_url":"https://github.com/aspnet/MusicStore.git","svn_url":"https://github.com/aspnet/MusicStore","homepage":"","size":10217,"stargazers_count":321,"watchers_count":321,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":195,"mirror_url":null,"open_issues_count":41,"forks":195,"open_issues":41,"watchers":321,"default_branch":"master"}},"base":{"label":"aspnet:dev","ref":"dev","sha":"97d9b2e385e8c99699b11c69a138b541c6547109","user":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"repo":{"id":16301196,"name":"MusicStore","full_name":"aspnet/MusicStore","owner":{"login":"aspnet","id":6476660,"avatar_url":"https://avatars.githubusercontent.com/u/6476660?v=3","gravatar_id":"","url":"https://api.github.com/users/aspnet","html_url":"https://github.com/aspnet","followers_url":"https://api.github.com/users/aspnet/followers","following_url":"https://api.github.com/users/aspnet/following{/other_user}","gists_url":"https://api.github.com/users/aspnet/gists{/gist_id}","starred_url":"https://api.github.com/users/aspnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aspnet/subscriptions","organizations_url":"https://api.github.com/users/aspnet/orgs","repos_url":"https://api.github.com/users/aspnet/repos","events_url":"https://api.github.com/users/aspnet/events{/privacy}","received_events_url":"https://api.github.com/users/aspnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aspnet/MusicStore","description":"Sample MusicStore application that uses MVC and Entity Framework.","fork":false,"url":"https://api.github.com/repos/aspnet/MusicStore","forks_url":"https://api.github.com/repos/aspnet/MusicStore/forks","keys_url":"https://api.github.com/repos/aspnet/MusicStore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aspnet/MusicStore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aspnet/MusicStore/teams","hooks_url":"https://api.github.com/repos/aspnet/MusicStore/hooks","issue_events_url":"https://api.github.com/repos/aspnet/MusicStore/issues/events{/number}","events_url":"https://api.github.com/repos/aspnet/MusicStore/events","assignees_url":"https://api.github.com/repos/aspnet/MusicStore/assignees{/user}","branches_url":"https://api.github.com/repos/aspnet/MusicStore/branches{/branch}","tags_url":"https://api.github.com/repos/aspnet/MusicStore/tags","blobs_url":"https://api.github.com/repos/aspnet/MusicStore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aspnet/MusicStore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aspnet/MusicStore/git/refs{/sha}","trees_url":"https://api.github.com/repos/aspnet/MusicStore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aspnet/MusicStore/statuses/{sha}","languages_url":"https://api.github.com/repos/aspnet/MusicStore/languages","stargazers_url":"https://api.github.com/repos/aspnet/MusicStore/stargazers","contributors_url":"https://api.github.com/repos/aspnet/MusicStore/contributors","subscribers_url":"https://api.github.com/repos/aspnet/MusicStore/subscribers","subscription_url":"https://api.github.com/repos/aspnet/MusicStore/subscription","commits_url":"https://api.github.com/repos/aspnet/MusicStore/commits{/sha}","git_commits_url":"https://api.github.com/repos/aspnet/MusicStore/git/commits{/sha}","comments_url":"https://api.github.com/repos/aspnet/MusicStore/comments{/number}","issue_comment_url":"https://api.github.com/repos/aspnet/MusicStore/issues/comments{/number}","contents_url":"https://api.github.com/repos/aspnet/MusicStore/contents/{+path}","compare_url":"https://api.github.com/repos/aspnet/MusicStore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aspnet/MusicStore/merges","archive_url":"https://api.github.com/repos/aspnet/MusicStore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aspnet/MusicStore/downloads","issues_url":"https://api.github.com/repos/aspnet/MusicStore/issues{/number}","pulls_url":"https://api.github.com/repos/aspnet/MusicStore/pulls{/number}","milestones_url":"https://api.github.com/repos/aspnet/MusicStore/milestones{/number}","notifications_url":"https://api.github.com/repos/aspnet/MusicStore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aspnet/MusicStore/labels{/name}","releases_url":"https://api.github.com/repos/aspnet/MusicStore/releases{/id}","created_at":"2014-01-28T03:35:13Z","updated_at":"2015-02-27T17:31:09Z","pushed_at":"2015-03-02T06:26:50Z","git_url":"git://github.com/aspnet/MusicStore.git","ssh_url":"git@github.com:aspnet/MusicStore.git","clone_url":"https://github.com/aspnet/MusicStore.git","svn_url":"https://github.com/aspnet/MusicStore","homepage":"","size":10217,"stargazers_count":321,"watchers_count":321,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":195,"mirror_url":null,"open_issues_count":41,"forks":195,"open_issues":41,"watchers":321,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/407"},"html":{"href":"https://github.com/aspnet/MusicStore/pull/407"},"issue":{"href":"https://api.github.com/repos/aspnet/MusicStore/issues/407"},"comments":{"href":"https://api.github.com/repos/aspnet/MusicStore/issues/407/comments"},"review_comments":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/407/comments"},"review_comment":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aspnet/MusicStore/pulls/407/commits"},"statuses":{"href":"https://api.github.com/repos/aspnet/MusicStore/statuses/72e6c9e6cea0f9751792dc99406c0c94f432f3c8"}}}}