Register DataProtection Services in tests
This commit is contained in:
parent
42c809ca16
commit
0e9fa31da5
|
|
@ -7,6 +7,7 @@ using Microsoft.AspNet.Builder;
|
|||
using Microsoft.AspNet.Identity.Test;
|
||||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.DependencyInjection.Fallback;
|
||||
using Microsoft.AspNet.Security.DataProtection;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||
|
|
@ -48,6 +49,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
|||
{
|
||||
DbUtil.ConfigureDbServices<IdentityDbContext>(ConnectionString, services);
|
||||
services.AddDefaultIdentity<IdentityDbContext, IdentityUser, IdentityRole>();
|
||||
services.Add(DataProtectionServices.GetDefaultServices());
|
||||
});
|
||||
|
||||
var userStore = builder.ApplicationServices.GetRequiredService<IUserStore<IdentityUser>>();
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ using Microsoft.Data.Entity;
|
|||
using Microsoft.Framework.DependencyInjection;
|
||||
using Microsoft.Framework.DependencyInjection.Fallback;
|
||||
using Microsoft.Framework.Logging;
|
||||
using Microsoft.AspNet.Security.DataProtection;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
||||
|
|
@ -53,6 +54,7 @@ namespace Microsoft.AspNet.Identity.EntityFramework.Test
|
|||
{
|
||||
DbUtil.ConfigureDbServices<ApplicationDbContext>(ConnectionString, services);
|
||||
services.AddDefaultIdentity<ApplicationDbContext, ApplicationUser, IdentityRole>();
|
||||
services.Add(DataProtectionServices.GetDefaultServices());
|
||||
});
|
||||
|
||||
var userStore = builder.ApplicationServices.GetRequiredService<IUserStore<ApplicationUser>>();
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ namespace Microsoft.AspNet.Identity.Test
|
|||
{
|
||||
services.Add(OptionsServices.GetDefaultServices());
|
||||
services.Add(HostingServices.GetDefaultServices());
|
||||
services.Add(DataProtectionServices.GetDefaultServices());
|
||||
services.AddDefaultIdentity<TUser, TRole>();
|
||||
AddUserStore(services, context);
|
||||
AddRoleStore(services, context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue