public static void PrepareDatabaseForTest(LadderDBContext db) { db.Ladders.AddRange( new LadderEntry() { LadderId = "existingLadder", Platform = "Nintendo360", Username = "******", Score = 666 }, new LadderEntry() { LadderId = "existingLadder", Platform = "Super Famicom", Username = "******", Score = 6666 }, new LadderEntry() { LadderId = "existingLadder", Platform = "Nintendo360", Username = "******", Score = 999999 } ); db.SaveChanges(); }
public LadderRepositoryTest() { var options = new DbContextOptionsBuilder <LadderDBContext>() .UseSqlite("DataSource=:memory:") .Options; var dbContext = new LadderDBContext(options); dbContext.Database.OpenConnection(); dbContext.Database.EnsureCreated(); _dbContext = dbContext; _logger = new Mock <ILoggerAdapter <LadderRepository> >(); }