using System;
using MusicMetaTagger.Client.AllMusicGuide.RemoteDataAccess.Client;
using NUnit.Framework;

namespace MusicMetaTagger.Client.AllMusicGuide.Tests.RemoteDataAccess.Client
{
	[TestFixture]
	public class WebXmlClientTests
	{
		[Test, Explicit]
		public void GetTestHtml()
		{
			var songClient = new SongClient();
			songClient.Read("hey-jude-mt0002046073").Save("Song-HeyJude.xml");

			var albumClient = new AlbumClient();
			albumClient.Read("abbey-road-mw0000192938").Save("Album-AbbeyRoad.xml");
			albumClient.Read("girls-can-tell-mw0000624315").Save("Album-GirlsCanTell.xml");
			albumClient.Read("kill-the-moonlight-mw0000222379").Save("Album-KillTheMoonlight.xml");
			albumClient.Read("magnolia-original-motion-picture-score-mw0000605476").Save("Album-MagnoliaScore.xml");
			albumClient.Read("pulp-fiction-mw0000118528").Save("Album-PulpFiction.xml");
			albumClient.Read("re-ac-tor-mw0000717742").Save("Album-Reactor.xml");
			albumClient.Read("wipers-box-set-mw0000541566").Save("Album-WipersBoxSet.xml");
			albumClient.Read("miike-snow-mw0000818771").Save("Album-MiikeSnow.xml");
			albumClient.Read("superwolf-mw0000363531").Save("Album-Superwolf.xml");
			albumClient.Read("dark-was-the-night-red-hot-compilation-mw0000807845").Save("Album-DarkWasTheNight.xml");
			albumClient.Read("true-love-waits-christopher-oriley-plays-radiohead-mw0000631718").Save("Album-TrueLoveWaits.xml");

			var albumResultClient = new AlbumResultPageClient();
			albumResultClient.Read("abbey road").Save("AlbumResults-AbbeyRoad.xml");

			var artistClient = new ArtistClient();
			artistClient.Read("the-beatles-mn0000754032").Save("Artist-Beatles.xml");
			artistClient.Read("spoon-mn0000131038").Save("Artist-Spoon.xml");
			artistClient.Read("neil-young-mn0000379125").Save("Artist-NeilYoung.xml");
			artistClient.Read("wipers-mn0000485791").Save("Artist-Wipers.xml");
			artistClient.Read("bonnie-prince-billy-mn0000094764").Save("Artist-BonniePrinceBilly.xml");

			var artistDiscographyAlbumPageClient = new ArtistDiscographyAlbumPageClient();
			artistDiscographyAlbumPageClient.Read("spoon-mn0000131038").Save("ArtistAlbums-Spoon.xml");

			var artistDiscographyCompilationPageClient = new ArtistDiscographyCompilationPageClient();
			artistDiscographyCompilationPageClient.Read("the-beatles-mn0000754032").Save("ArtistCompilations-Beatles.xml");
			artistDiscographyCompilationPageClient.Read("wipers-mn0000485791").Save("ArtistCompilations-Wipers.xml");

			var artistDiscographyEpSinglesPageClient = new ArtistDiscographyEpSinglesPageClient();
			artistDiscographyEpSinglesPageClient.Read("the-beatles-mn0000754032").Save("ArtistSingles-Beatles.xml");

			var artistResultPageClient = new ArtistResultPageClient();
			artistResultPageClient.Read("spoon").Save("ArtistResults-Spoon.xml");

			var songResultsPageClient = new SongResultPageClient();
			songResultsPageClient.Read("Hey, Snow White").Save("SongResults-HeySnowWhite.xml");
		}
		
		[Test, Explicit]
		public void HtmlScraperTest()
		{
			var url = new Uri("http://www.google.com");
			var xml = WebXmlClient.GetHtmlXml(url);
			Assert.IsNotNull(xml);
		}
	}
}