Exemplo n.º 1
0
        public void TestAllGames()
        {
            var options   = new DbContextOptionsBuilder <MusicSpotDbContext>().UseInMemoryDatabase("returnGamesNotNull").Options;
            var dbContext = new MusicSpotDbContext(options);
            var service   = new GameService(dbContext);

            var game = new Game
            {
                Title       = "FIFA",
                Genre       = "Sport",
                ImageUrl    = "aaa",
                Description = "some description",
                UserId      = "aaa"
            };

            var result = service.AllGames(game.UserId, "sport", 5, 5);

            Assert.That(result, Is.Not.Null);
            Assert.AreEqual(1, result.Id);
            Assert.AreEqual("aaa", result.Result.UserId);
            Assert.AreEqual("sport", result.Result.SearchTerm);
            Assert.AreNotEqual(7, result.Result.PageNum);
        }