public static BattleshipDbContext Create() { var options = new DbContextOptionsBuilder <BattleshipDbContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var context = new BattleshipDbContext(options); context.Database.EnsureCreated(); return(context); }
public TestBase() { _context = BattleshipDbContextFactory.Create(); }
public static void Destroy(BattleshipDbContext context) { context.Database.EnsureDeleted(); context.Dispose(); }
public static PlayerRecord NewPlayer(this BattleshipDbContext context) => new PlayerRecord(context);
public static GameRecord NewGame(this BattleshipDbContext context) => new GameRecord(context);
public static ShotRecord NewShot(this BattleshipDbContext context) => new ShotRecord(context);
public static BoardRecord NewBoard(this BattleshipDbContext context) => new BoardRecord(context);