private SkyWalkerDbContext GetDbContext() { var options = new DbContextOptionsBuilder <SkyWalkerDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()).Options; var dbContext = new SkyWalkerDbContext(options); dbContext.AppUsers.Add(new AppUser() { Id = 1, UserId = "yemobai", UserName = "******", UserPassWord = "******" }); dbContext.Add(new AppUser() { Id = 2, UserId = "123", UserName = "******", UserPassWord = "******" }); dbContext.SaveChanges(); return(dbContext); }
public UserController(SkyWalkerDbContext _dbContext, IRepository <AppUser> _repository) { dbContext = _dbContext; userRepository = _repository; }
public UserControllerTest() { dbContext = this.GetDbContext(); }
public ValuesController(SkyWalkerDbContext _dbContext) { dbContext = _dbContext; }