public async Task ReturnAllMovies() { var moviesResponse = new List <FilmesResponse>() { new FilmesResponse { Id = Guid.NewGuid().ToString(), Score = 7.8, Title = "Fake Movie", Year = 2018 }, new FilmesResponse { Id = Guid.NewGuid().ToString(), Score = 3.8, Title = "The Fake Movie", Year = 2019 } }; filmesServiceMock.Setup(x => x.GetCurrentChampionship()) .ReturnsAsync(moviesResponse); var response = await movieAppService.GetAll(); Assert.NotEmpty(response); Assert.NotNull(response); Assert.Equal(moviesResponse.Count, response.Count()); }
public void ApplService_Movie_GetAll_Deve_Chamar_OMetodo_GetAll() { //Arrange IQueryable <Movie> movieList = ObjectMother.movieListDefault; _repository.Setup(x => x.GetAll()).Returns(movieList); //Action List <Movie> movieResultList = _appService.GetAll().ToList(); //Assert _repository.Verify(x => x.GetAll()); movieResultList.Should().NotBeNull(); movieResultList.Should().HaveCount(3); _repository.VerifyNoOtherCalls(); }