public void Debug_InsertSerie(int a_index) { var sd = new SerieData(); sd.Seed = m_random.Next(); sd.SetTitleURL(">>> added serie " + m_random.Next()); m_series.Insert(a_index, sd); }
public void Debug_InsertSerie(int a_index) { var sd = new SerieData {Seed = m_random.Next()}; sd.SetTitleURL(">>> added serie " + m_random.Next()); m_series.Insert(a_index, sd); }
public TestServerCrawler(string a_name, int a_max_server_delay, bool a_slow_series, bool a_slow_chapters, bool a_empty, int a_max_con) { m_name = a_name; m_seed = a_name.GetHashCode(); var random = new Random(m_seed); m_slow_series = a_slow_series; m_slow_chapters = a_slow_chapters; if (a_max_server_delay != 0) Debug.Assert(a_max_server_delay > MIN_SERVER_DELAY); m_max_server_delay = a_max_server_delay; m_items_per_page = random.Next(4, 9) * 5; m_max_con = a_max_con; var maxs = (int)Math.Pow(random.Next(10, 70), 2); if (Name.Contains("error series few")) maxs = 3456; for (var s = 1; s <= maxs; s++) { var serie = new SerieData(); serie.SetTitleURL(a_name + " - Serie" + s.ToString()); serie.Seed = random.Next(); m_series.Add(serie); } { var serie = new SerieData(); serie.SetTitleURL(a_name + " - empty chapters"); m_series.Add(serie); } { var serie = new SerieData(); serie.SetTitleURL(a_name + " - error chapters none"); serie.Seed = random.Next(); m_series.Add(serie); } { var serie = new SerieData(); serie.SetTitleURL(a_name + " - error chapters few"); serie.Seed = random.Next(); m_series.Add(serie); } { var serie = new SerieData(); serie.SetTitleURL(a_name + " - few chapters"); serie.Seed = random.Next(); m_series.Add(serie); } if (Name.Contains("error series none")) m_series.Clear(); if (a_empty) m_series.Clear(); }
public TestServerCrawler(string a_name, int a_max_server_delay, bool a_slow_series, bool a_slow_chapters, bool a_empty, int a_max_con) { m_name = a_name; m_seed = a_name.GetHashCode(); Random random = new Random(m_seed); m_slow_series = a_slow_series; m_slow_chapters = a_slow_chapters; if (a_max_server_delay != 0) { Debug.Assert(a_max_server_delay > MIN_SERVER_DELAY); } m_max_server_delay = a_max_server_delay; m_items_per_page = random.Next(4, 9) * 5; m_max_con = a_max_con; int maxs = (int)Math.Pow(random.Next(10, 70), 2); if (Name.Contains("error series few")) { maxs = 3456; } for (int s = 1; s <= maxs; s++) { SerieData serie = new SerieData(); serie.SetTitleURL(a_name + " - Serie" + s.ToString()); serie.Seed = random.Next(); m_series.Add(serie); } { SerieData serie = new SerieData(); serie.SetTitleURL(a_name + " - empty chapters"); m_series.Add(serie); } { SerieData serie = new SerieData(); serie.SetTitleURL(a_name + " - error chapters none"); serie.Seed = random.Next(); m_series.Add(serie); } { SerieData serie = new SerieData(); serie.SetTitleURL(a_name + " - error chapters few"); serie.Seed = random.Next(); m_series.Add(serie); } { SerieData serie = new SerieData(); serie.SetTitleURL(a_name + " - few chapters"); serie.Seed = random.Next(); m_series.Add(serie); } if (Name.Contains("error series none")) { m_series.Clear(); } if (a_empty) { m_series.Clear(); } }