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 TestBase() { InMemoryDatabaseContext = StorageBuilder.GetInMemContext(); UnitOfWork = (UnitOfWork)StorageBuilder.GetUnitOfWork(InMemoryDatabaseContext); }