예제 #1
0
        public void AddImageUrlShouldAddImageToGame()
        {
            var options = new DbContextOptionsBuilder <ApplicationDbContext>()
                          .UseInMemoryDatabase(databaseName: "AddImageUrlShouldAddImageToGame_DB")
                          .Options;

            var dbContext = new ApplicationDbContext(options);

            var gameService = new GameService(dbContext);

            var imageUrl = "asdadsasdasdasdasd";

            var game = new Game();

            dbContext.Games.Add(game);
            dbContext.SaveChanges();

            gameService.AddImageUrl(game.Id, imageUrl);

            Assert.Equal(imageUrl, game.GamePicturePath);
        }