Exemplo n.º 1
0
        public async Task GetAllByQuery_WithNullInput_ShouldReturnValidResult(string title)
        {
            var dbContext = ApplicationDbContextCreatorInMemory.InitializeContext();

            await this.SeedData(dbContext);

            var moviesRepository = new EfDeletableEntityRepository <Movie>(dbContext);
            var genresRepository = new EfDeletableEntityRepository <Genre>(dbContext);
            var service          = new MoviesService(moviesRepository, genresRepository);

            var result = service.GetAllByQuery <MovieViewModel>(title).ToList();

            Assert.Equal(2, result.Count());
        }