コード例 #1
0
        public void ClearBogtyvenChaptersTest()
        {
            var writer = new EpubWriter(EpubReader.Read(@"Samples/epub-assorted/bogtyven.epub"));

            writer.ClearChapters();

            var epub = WriteAndRead(writer);

            Assert.AreEqual(0, epub.TableOfContents.Count);
        }
コード例 #2
0
ファイル: EpubWriterTests.cs プロジェクト: pgung/EpubSharp
        public void ClearBogtyvenChaptersTest()
        {
            var writer = new EpubWriter(EpubReader.Read(@"Samples/epub-assorted/afrique_du_sud_2016_carnet_petit_fute.epub", null));

            writer.ClearChapters();

            var epub = WriteAndRead(writer);

            Assert.AreEqual(0, epub.TableOfContents.EpubChapters.Count());
        }
コード例 #3
0
        public void ClearChaptersTest()
        {
            var writer = new EpubWriter();

            writer.AddChapter("Chapter 1", "bla bla bla");
            writer.AddChapter("Chapter 2", "foo bar");
            writer.AddChapter("Chapter 3", "fooz barz");

            var epub = WriteAndRead(writer);

            Assert.AreEqual(3, epub.TableOfContents.Count);

            writer = new EpubWriter(epub);
            writer.ClearChapters();

            epub = WriteAndRead(writer);
            Assert.AreEqual(0, epub.TableOfContents.Count);
        }