示例#1
0
        public async Task Update_Book_PageCount()
        {
            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.PageCount.Should().Be(123);

            await BookHelpers.UpdatePageCount(sut.Id, 321);

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

            sut.PageCount.Should().Be(321);
            sut.Id.Should().Be(bookId);
        }