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 SongTests
	{
		private Song _heyJude;

		[SetUp]
		public void SetUp()
		{
			var doc = new XmlDocument();
			doc.Load("Song-HeyJude.xml");
			_heyJude = new SongParser().Parse(doc);
		}

		[Test]
		public void SongTestSuite()
		{
			Assert.AreEqual("Hey Jude", _heyJude.SongTitle);
			Assert.AreEqual("mt0002046073", _heyJude.SongId);
			Assert.That(_heyJude.AppearsOnAlbum.Count, Is.GreaterThan(1));

			var firstAlbum = _heyJude.AppearsOnAlbum[0];
			Assert.That(firstAlbum.AlbumTitle, Is.EqualTo("Hey Jude"));
			Assert.That(firstAlbum.ArtistName, Is.EqualTo("The Beatles"));
			Assert.That(firstAlbum.Year, Is.EqualTo(1970));
		}
	}
}