public bool Compare(SerieTestData a_downloaded) { if (a_downloaded.ChapterCount != ChapterCount) { return(false); } if (a_downloaded.Title != Title) { return(false); } if (a_downloaded.URL != URL) { return(false); } for (int i = 0; i < Chapters.Count; i++) { if (!Chapters[i].Compare(a_downloaded.Chapters[i])) { return(false); } } return(true); }
public static ServerTestData Load(string a_file_path) { XElement root = XElement.Load(a_file_path); var name = root.Element("Name").Value; Assert.IsTrue(!String.IsNullOrWhiteSpace(name)); var std = Create(DownloadManager.Instance.Servers.First(s => s.Name == name)); std.SerieCount = Int32.Parse(root.Element("SerieCount").Value); foreach (var serie_node in root.Element("Series").Elements()) { std.Series.Add(SerieTestData.Load(serie_node, std)); } return(std); }
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); }
public void AddSeries(SerieTestData a_serie) { Series.Add(a_serie); a_serie.ServerTestData = this; }
public bool Compare(SerieTestData a_downloaded) { if (a_downloaded.ChapterCount != ChapterCount) return false; if (a_downloaded.Title != Title) return false; if (a_downloaded.URL != URL) return false; for (int i = 0; i < Chapters.Count; i++) { if (!Chapters[i].Compare(a_downloaded.Chapters[i])) return false; } return true; }
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; }
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; }