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

namespace MusicMetaTagger.Client.AllMusicGuide.Tests.RemoteDataAccess
{
	[TestFixture]
	public class MusicGuideScraperTests
	{
		private MusicGuideScraper _musicGuideScraper;

		[SetUp]
		public void SetUp()
		{
			_musicGuideScraper = new MusicGuideScraper(
				new AlbumScraper(), new AlbumResultPageScraper(),
				new ArtistScraper(), new ArtistResultPageScraper(), new ArtistDiscographyScraper(),
				new SongResultPageScraper(), new SongScraper());
		}

		[Test, Explicit]
		public void SearchArtist_SmokeTest()
		{
			var artistResults = _musicGuideScraper.SearchArtist("Beech Boys");
			foreach (var artistResult in artistResults)
			{
				Console.WriteLine("{0}, {1}, {2}", artistResult.ArtistName, artistResult.ResultOrder, artistResult.YearsActive);
			}
		}

		[Test, Explicit]
		public void SearchAlbum_SmokeTest()
		{
			var albumResults = _musicGuideScraper.SearchAlbum("smile sessions");
			foreach (var albumResult in albumResults)
			{
				Console.WriteLine("{0}, {1}, {2}", albumResult.ArtistName, albumResult.ResultOrder, albumResult.AlbumTitle);
			}
		}

		[Test, Explicit]
		public void SearchSong_SmokeTest()
		{
			var albumResults = _musicGuideScraper.SearchSong("...and the World Laughs With You");
			foreach (var albumResult in albumResults)
			{
				Console.WriteLine("{0}, {1}, {2}", albumResult.ArtistName, albumResult.SongTitle, albumResult.ResultOrder);
			}
		}
	}
}
