Ejemplo n.º 1
0
        public async Task FindMovies_WhenMetadataUpdaterReturnsMovies_ReturnsThose()
        {
            // Arrange
            IEnumerable <Movie> movies = new List <Movie>
            {
                new Movie {
                    Title = "The Movie About Stuff"
                },
                new Movie {
                    Title = "Great Stuff"
                }
            };

            _metadataUpdater.FindMovies("Stuff")
            .Returns(movies.ToTask());

            // Act
            IEnumerable <Movie> actualMovies = await _service.FindMovies("Stuff");

            // Assert
            Assert.Equal(2, actualMovies.Count());
            Assert.Contains(movies.ElementAt(0), actualMovies);
            Assert.Contains(movies.ElementAt(1), actualMovies);
        }
 /// <summary>
 /// Finds the movis summary that match the given name.
 /// </summary>
 /// <param name="name">The movie name.</param>
 /// <returns></returns>
 public Task <IEnumerable <Movie> > FindMovies(string name)
 {
     return(_metadataUpdater.FindMovies(name));
 }