コード例 #1
0
        public async Task given_entity_not_found_then_FindMovie_returns_null(
            MovieReadModelFacade sut, Guid movieId)
        {
            MovieDto actual = await sut.FindMovie(movieId);

            actual.Should().BeNull();
        }
コード例 #2
0
        public async Task GetAllMovies_sort_transfer_objects_by_CreatedAt(
            ImmutableArray <Movie> entities,
            InMemoryMovieRepository readerStub)
        {
            entities.ForEach(x => readerStub.Data[x.Id] = x);
            var sut = new MovieReadModelFacade(readerStub);

            ImmutableArray <MovieDto> actual = await sut.GetAllMovies();

            actual.Should().BeInDescendingOrder(x => x.CreatedAt);
        }
コード例 #3
0
        public async Task FindMovie_assembles_dto_correctly(
            Movie movie, InMemoryMovieRepository readerStub)
        {
            readerStub.Data[movie.Id] = movie;
            var sut = new MovieReadModelFacade(readerStub);

            MovieDto actual = await sut.FindMovie(movie.Id);

            actual.Should().BeEquivalentTo(
                expectation: movie,
                config: c => c.ExcludingMissingMembers());
        }
コード例 #4
0
        public async Task GetAllMovies_assembles_all_transfer_objects_correctly(
            ImmutableArray <Movie> movies,
            InMemoryMovieRepository readerStub)
        {
            movies.ForEach(x => readerStub.Data[x.Id] = x);
            var sut = new MovieReadModelFacade(readerStub);

            ImmutableArray <MovieDto> actual = await sut.GetAllMovies();

            actual.Should().BeEquivalentTo(
                expectation: movies,
                config: c => c.ExcludingMissingMembers());
        }