// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using Microsoft.Framework.DependencyInjection; using Xunit; namespace Microsoft.AspNet.Identity.EntityFramework.Test { public class GuidUser : IdentityUser { public GuidUser() { Id = Guid.NewGuid(); UserName = Id.ToString(); } } public class GuidRole : IdentityRole { public GuidRole() { Id = Guid.NewGuid(); Name = Id.ToString(); } } [TestCaseOrderer("Microsoft.AspNet.Identity.Test.PriorityOrderer", "Microsoft.AspNet.Identity.EntityFramework.Test")] public class UserStoreGuidTest : SqlStoreTestBase { private readonly string _connectionString = @"Server=(localdb)\mssqllocaldb;Database=SqlUserStoreGuidTest" + DateTime.Now.Month + "-" + DateTime.Now.Day + "-" + DateTime.Now.Year + ";Trusted_Connection=True;"; public override string ConnectionString { get { return _connectionString; } } public class ApplicationUserStore : UserStore { public ApplicationUserStore(TestDbContext context) : base(context) { } } public class ApplicationRoleStore : RoleStore { public ApplicationRoleStore(TestDbContext context) : base(context) { } } protected override void AddUserStore(IServiceCollection services, object context = null) { services.AddInstance>(new ApplicationUserStore((TestDbContext)context)); } protected override void AddRoleStore(IServiceCollection services, object context = null) { services.AddInstance>(new ApplicationRoleStore((TestDbContext)context)); } } }