Ejemplo n.º 1
0
        public void TestPageExistance()
        {
            bookChapterPage page1 = aBook.chapters[0].pages[0];

            Assert.IsNotNull(page1);

            Assert.AreEqual(page1.id, "page1");
        }
        public void TestPageExistance()
        {
            aPage.id = "page3";
            chapter1.pages.SetValue(aPage, 2);
            bookChapterPage page1 = aBook.chapters[0].pages[0];
            bookChapterPage page2 = aBook.chapters[0].pages[1];
            bookChapterPage page3 = aBook.chapters[0].pages[2];

            Assert.IsNotNull(page1);
            Assert.IsNotNull(page2);
            Assert.IsNotNull(page3);

            Assert.AreEqual(page1.id, "page1");
        }
        public UnitTestBookRepository()
        {
            bookRepository = new BookRepository();
            aBook          = new book();
            var serializer = new XmlSerializer(typeof(book));
            var stream     = new FileStream("C:/Users/andresc/Desktop/Fairy-tales/fairytales/BookWriterTool/BookWriterTool/Content/Resources/Test/bookNoMetadata2.xml", FileMode.Open);

            aBook = serializer.Deserialize(stream) as book;
            stream.Close();
            chapter1 = aBook.chapters[0];
            aPage    = new bookChapterPage();
            bookChapterPage[] apage    = aBook.chapters[0].pages;
            bookChapter[]     achapter = aBook.chapters;
            numberOfChapters = achapter.Length;
            numberOfPages    = apage.Length;
        }