Пример #1
0
        public async Task ExportDocument_AndReload_SameContent()
        {
            var sampleFileInfo = GetSampleFileInfo(SampleFileName);

            using (var fileReadStream = sampleFileInfo.OpenRead())
            {
                // loading document first time
                var firstDocument = new Fb2Document();
                await firstDocument.LoadAsync(fileReadStream);

                var firstDocXml    = firstDocument.ToXml();
                var secondDocument = new Fb2Document();
                secondDocument.Load(firstDocXml);

                firstDocument.Should().Be(secondDocument);

                var firstBook  = firstDocument.Book;
                var secondBook = secondDocument.Book;

                firstBook.Should().Be(secondBook);
            }
        }