public PlayerProgressRepositoryTests() { _contextFactory = new QuestEngineContextFactory( new ContextConfiguration { InMemoryDb = true }); _context = _contextFactory.Create(); _context.PlayerProgresses.AddRange(new[] { new PlayerProgress { QuestId = 1, PlayerId = "player1", QuestPointsEarned = 1, }, new PlayerProgress { QuestId = 2, PlayerId = "player1", QuestPointsEarned = 2 }, new PlayerProgress { QuestId = 1, PlayerId = "player2", QuestPointsEarned = 3 } }); _context.SaveChanges(); }
public QuestEngineContext CreateDbContext(string[] args) { var configuration = new ConfigurationBuilder().AddJsonFile("appsettings.json").Build(); var contextFactory = new QuestEngineContextFactory(new Configuration.ContextConfiguration { ConnectionString = configuration.GetConnectionString("QuestEngineDb"), InMemoryDb = false }); return(contextFactory.Create()); }