Exemplo n.º 1
0
        public async Task GetMoviesShouldZeroLoadMovies()
        {
            // Act
            var request = new MoviesController.MoviesRequest();
            IEnumerable<Movie> movies = await _controller.GetMovies(request);

            // Assert
            Assert.AreEqual(0, movies.Count());
        }
Exemplo n.º 2
0
        public async Task GetMoviesShouldOneLoadMovies()
        {
            // Arrange
            await _session.StoreAsync(new Movie());
            await _session.SaveChangesAsync();

            // Act
            var request = new MoviesController.MoviesRequest();
            IEnumerable<Movie> movies = await _controller.GetMovies(request);

            // Assert
            Assert.AreEqual(1, movies.Count());
        }
Exemplo n.º 3
0
        public async Task GetMoviesShouldZeroLoadMovieWithGenre()
        {
            // Arrange
            await _session.StoreAsync(new Movie { Genres = new[] { "g1" } });
            await _session.StoreAsync(new Movie());
            await _session.SaveChangesAsync();

            // Act
            var request = new MoviesController.MoviesRequest { Genres = new[] { "g2" } };
            IEnumerable<Movie> movies = await _controller.GetMovies(request);

            // Assert
            Assert.AreEqual(0, movies.Count());
        }