Пример #1
0
        public async Task Update_Book_Isbn()
        {
            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.Isbn.Should().Be("9781566199094");

            await BookHelpers.UpdateIsbn(sut.Id, "000224585X");

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

            sut.Isbn.Should().Be("000224585X");
            sut.Id.Should().Be(bookId);
        }