Esempio n. 1
0
        public Game Create(Game newGame)
        {
            int id = _repo.Create(newGame);

            newGame.Id = id;
            return(newGame);
        }
Esempio n. 2
0
        public async Task CreatesGame()
        {
            using (var context = new ApplicationDbContext(_options))
            {
                var gamesRepository = new GamesRepository(context);

                await gamesRepository.Create(new Game { Id = 1 });
            }

            using (var context = new ApplicationDbContext(_options))
            {
                Assert.Equal(1, context.Games.Count());
                Assert.Equal(1, context.Games.Single().Id);
            }
        }
 public Game Create(Game newGame)
 {
     return _repo.Create(newGame);
 }