public bool Compare(ChapterTestData a_downloaded)
        {
            if (a_downloaded.PageCount != PageCount)
            {
                return(false);
            }
            if (a_downloaded.Title != Title)
            {
                return(false);
            }
            if (a_downloaded.URL != URL)
            {
                return(false);
            }
            if (a_downloaded.Index != Index)
            {
                return(false);
            }

            for (int i = 0; i < Pages.Count; i++)
            {
                if (!Pages[i].Compare(a_downloaded.Pages[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #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;
        }
        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);
        }
        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);
        }
        public static SerieTestData Load(XElement a_node, ServerTestData a_server_test_data)
        {
            SerieTestData std = new SerieTestData();

            std.ChapterCount   = Int32.Parse(a_node.Element("ChapterCount").Value);
            std.Title          = a_node.Element("Title").Value;
            std.URL            = a_node.Element("URL").Value;
            std.ServerTestData = a_server_test_data;

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

            if (a_node.Element("Chapters") != null)
            {
                foreach (var chapter_node in a_node.Element("Chapters").Elements())
                {
                    std.Chapters.Add(ChapterTestData.Load(chapter_node, std));
                }
            }

            return(std);
        }
Beispiel #6
0
        public bool Compare(ChapterTestData a_downloaded)
        {
            if (a_downloaded.PageCount != PageCount)
                return false;
            if (a_downloaded.Title != Title)
                return false;
            if (a_downloaded.URL != URL)
                return false;
            if (a_downloaded.Index != Index)
                return false;

            for (int i = 0; i < Pages.Count; i++)
            {
                if (!Pages[i].Compare(a_downloaded.Pages[i]))
                    return false;
            }

            return true;
        }
Beispiel #7
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;
        }