Ejemplo n.º 1
0
		public void productionmusic()
		{
			var webClient = new WebClient();

			string url = string.Format("{0}/productionmusic/ambient", host);

			var all = new Dictionary<string, string[]>();
			all.Add("genre",null);
			all.Add("use", null);
			all.Add("mood", null);
			all.Add("inst", null);

			Regex split = new Regex(@"'[\s\S][^']*'",RegexOptions.Compiled);

			// load HTML page
			string page = webClient.DownloadString(url);

			var source = new HtmlReader<Tags.Input>().Read(page)
				.Where(i => i.OnChange != null && i.Type != null && string.CompareOrdinal(i.Type, "checkbox") == 0)
				.ToArray();



			foreach (var list in all.Keys.ToArray())
			{
				all[list] = source.Where(i => i.OnChange.Contains(list + "_list"))
						.Distinct()
						.Select(i => split.Matches(i.OnChange)[2].Value.Replace("'", string.Empty))
						.OrderBy(i => i)
						.ToArray();

				Assert.IsNotNull(list, list + " not found");
			}

		}