using System.Collections.Generic;
using System.Xml;
using MusicMetaTagger.Client.AllMusicGuide.RemoteDataAccess.Parser;
using MusicMetaTagger.Core.Model;
using NUnit.Framework;

namespace MusicMetaTagger.Client.AllMusicGuide.Tests.RemoteDataAccess.Parser
{
	[TestFixture]
	public class SongResultTests
	{
		private IList<SongResult> _songResults;

		[SetUp]
		public void SetUp()
		{
			var doc = new XmlDocument();
			doc.Load("SongResults-HeySnowWhite.xml");
			_songResults = new SongResultPageParser().Parse(doc);
		}

		[Test]
		public void SongResultsTestSuite()
		{
			Assert.IsTrue(_songResults.Count > 0);
			var resultInfo = _songResults[0];
			Assert.AreEqual("The New Pornographers", resultInfo.ArtistName);
			Assert.AreEqual(1, resultInfo.ResultOrder);
			Assert.AreEqual("mt0031275831", resultInfo.SongId);
			Assert.AreEqual("Hey, Snow White", resultInfo.SongTitle);

			Assert.AreNotEqual("The New Pornographers", _songResults[1].ArtistName);
			Assert.AreEqual(2, _songResults[1].ResultOrder);
		}
	}
}