public RoleTestBase() { //Context = StorageBuilder.GetContext(); //UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(Context); InMemoryDatabaseContext = StorageBuilder.GetInMemContextUserAndRoleData(); UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(InMemoryDatabaseContext); var configuration = new MapperConfiguration(cfg => cfg.AddProfile <IdentityEntitiesToModelsMappingProfile>()); //var configuration = new MapperConfiguration(cfg => new IdentityEntitiesToModelsMappingProfile()); var mapper = configuration.CreateMapper(); RoleStore = new RoleStore(UnitOfWork, mapper); }
public HardCodedBase() { // Using real database //var RealDatabaseContext = StorageBuilder.GetContext(); //UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(RealDatabaseContext); //DatabaseContext = RealDatabaseContext; // Using in-memory database var InMemoryDatabaseContext = StorageBuilder.GetInMemContextWithRoleData(); DatabaseContext = InMemoryDatabaseContext; UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(InMemoryDatabaseContext); // Configure auto-mapper var configuration = new MapperConfiguration(cfg => cfg.AddProfile <IdentityEntitiesToModelsMappingProfile>()); var mapper = configuration.CreateMapper(); }
public UserTestBase(InMemoryDatabaseTypes type) { switch (type) { case InMemoryDatabaseTypes.USER_ROLE: InMemoryDatabaseContext = StorageBuilder.GetInMemContextUserAndRoleData(); break; case InMemoryDatabaseTypes.USER: break; case InMemoryDatabaseTypes.CLEAN: InMemoryDatabaseContext = StorageBuilder.GetInMemContext(); break; default: InMemoryDatabaseContext = StorageBuilder.GetInMemContext(); break; } UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(InMemoryDatabaseContext); //var configuration = new MapperConfiguration(cfg => new IdentityEntitiesToModelsMappingProfile()); var config = new MapperConfiguration(cfg => { cfg.AddProfile <IdentityEntitiesToModelsMappingProfile>(); cfg.AddProfile <ViewModelToEntityMappingProfile>(); }); Mapper = config.CreateMapper(); var roleStore = new RoleStore(UnitOfWork, Mapper); UserStore = new UserStore(UnitOfWork, roleStore, Mapper); //Initialize the users list Users = new List <ApplicationUser> { new ApplicationUser { GivenName = "Ola", Email = "*****@*****.**", PasswordHash = "jh7asd6am" } }; }
public RealDatabase() { DatabaseContext = StorageBuilder.GetContext(); UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(DatabaseContext); }
public TestBase() { InMemoryDatabaseContext = StorageBuilder.GetInMemContext(); UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(InMemoryDatabaseContext); }