using System.Linq;
using LeafWeb.Core.Charter;
using LeafWeb.Core.Entities;
using LeafWeb.Core.Parsers;
using LeafWeb.Core.Utility;
using NUnit.Framework;

namespace LeafWeb.Core.Tests.Charter
{
	public class CurveDataConverterTests
	{
		private const string ContentDirectory = @"Parsers\LeafOutputData\";

		[Test]
		public void Convert_Valid()
		{
			var fileInfo = FileUtility.GetContentFile(ContentDirectory, "cntrlcomparison_Wild Capsicum.csv");
			CntrlComparison[] cntrlComparison;
			using (var parser = new CntrlComparisonParser(fileInfo))
				cntrlComparison = parser.Parse();

			var curves = CurveDataConverter.Convert(cntrlComparison);
			Assert.That(curves.Count(),Is.EqualTo(7));
		}
	}
}