示例#1
0
        public async Task AddGenre()
        {
            var genre    = CreateGenres().First();
            var genreDto = Map(genre);

            _mockingHelper.RepositoryMovie
            .Setup(_ => _.AddGenreAsync(It.IsAny <Genre>()))
            .ReturnsAsync(It.IsAny <long>());

            _mockingHelper.RepositoryMovie
            .Setup(_ => _.GetActiveGenreByIdAsync(It.IsAny <long>()))
            .ReturnsAsync(genre);

            var result = await _movieService.AddGenreAsync(genreDto);

            result.Should().BeEquivalentTo(genreDto);
        }