Example #1
0
        public async void CanCreateMoreThanOneGameBoard()
        {
            Microsoft.EntityFrameworkCore.DbContextOptions <SudokuDbContext> options = new
                                                                                       DbContextOptionsBuilder <SudokuDbContext>().UseInMemoryDatabase
                                                                                           ("CreateMultipleGameBoards").Options;

            using (SudokuDbContext context = new SudokuDbContext(options))
            {
                //Arrange
                GameBoard gameboard = new GameBoard();
                gameboard.ID     = 1;
                gameboard.Placed = 2;

                //Act
                GameBoardManager GBM = new GameBoardManager(context);
                await GBM.CreateGameBoard(gameboard);

                await GBM.GetGameBoards();

                var result = context.GameBoards.FirstOrDefault(g => g.ID == g.ID);

                Assert.Equal(gameboard, result);
            }
        }