Пример #1
0
        public static PageTestData Load(XElement a_node, ChapterTestData a_chapter_test_data)
        {
            PageTestData ptd = new PageTestData();

            ptd.Index           = Int32.Parse(a_node.Element("Index").Value);
            ptd.Name            = a_node.Element("Name").Value;
            ptd.Hash            = a_node.Element("Hash").Value;
            ptd.URL             = a_node.Element("URL").Value;
            ptd.ChapterTestData = a_chapter_test_data;
            ptd.ImageURL        = a_node.Element("ImageURL").Value;

            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.Name));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.Hash));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.URL));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.ImageURL));

            return(ptd);
        }
Пример #2
0
        public static PageTestData Load(XElement a_node, ChapterTestData a_chapter_test_data)
        {
            PageTestData ptd = new PageTestData();

            ptd.Index = Int32.Parse(a_node.Element("Index").Value);
            ptd.Name = a_node.Element("Name").Value;
            ptd.Hash = a_node.Element("Hash").Value;
            ptd.URL = a_node.Element("URL").Value;
            ptd.ChapterTestData = a_chapter_test_data;
            ptd.ImageURL = a_node.Element("ImageURL").Value;

            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.Name));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.Hash));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.URL));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ptd.ImageURL));

            return ptd;
        }
Пример #3
0
        public static ChapterTestData Load(XElement a_node, SerieTestData a_serie_test_data)
        {
            ChapterTestData ctd = new ChapterTestData();

            ctd.PageCount     = Int32.Parse(a_node.Element("PageCount").Value);
            ctd.Index         = Int32.Parse(a_node.Element("Index").Value);
            ctd.Title         = a_node.Element("Title").Value;
            ctd.URL           = a_node.Element("URL").Value;
            ctd.SerieTestData = a_serie_test_data;

            Assert.IsTrue(!String.IsNullOrWhiteSpace(ctd.Title));
            Assert.IsTrue(!String.IsNullOrWhiteSpace(ctd.URL));

            foreach (var page_node in a_node.Element("Pages").Elements())
            {
                ctd.Pages.Add(PageTestData.Load(page_node, ctd));
            }

            return(ctd);
        }
Пример #4
0
        public bool Compare(PageTestData a_downloaded)
        {
            if (a_downloaded.Hash != Hash)
            {
                return(false);
            }
            if (a_downloaded.Name != Name)
            {
                return(false);
            }
            if (a_downloaded.ImageURL != ImageURL)
            {
                return(false);
            }
            if (a_downloaded.URL != URL)
            {
                return(false);
            }

            return(true);
        }
Пример #5
0
 public void AddPage(PageTestData a_page)
 {
     Pages.Add(a_page);
     a_page.ChapterTestData = this;
 }
Пример #6
0
        public bool Compare(PageTestData a_downloaded)
        {
            if (a_downloaded.Hash != Hash)
                return false;
            if (a_downloaded.Name != Name)
                return false;
            if (a_downloaded.ImageURL != ImageURL)
                return false;
            if (a_downloaded.URL != URL)
                return false;

            return true;
        }
Пример #7
0
 public void AddPage(PageTestData a_page)
 {
     Pages.Add(a_page);
     a_page.ChapterTestData = this;
 }