コード例 #1
0
        public async Task Update_Book_Description()
        {
            var book = await BookHelpers.CreateValidBookWithAllProperties();

            var repository = new BookRepository(_fixture.Context);

            (await repository.ExistsAsync(book.Id)).Should().BeTrue();

            var sut = await repository.GetAsync(book.Id);

            var bookId = sut.Id;

            sut.Should().NotBeNull();
            sut.Description.Should().Be("description");

            await BookHelpers.UpdateDescription(sut.Id, "Could I please have book number three?");

            await _fixture.Context.Entry(sut).ReloadAsync();

            sut.Description.Should().Contain("Could I please");
            sut.Id.Should().Be(bookId);
        }