32 lines
772 B
C#
32 lines
772 B
C#
using System;
|
|
using System.IO;
|
|
using LeafWeb.Core.Charter;
|
|
using NUnit.Framework;
|
|
|
|
namespace LeafWeb.Core.Tests.Parsers
|
|
{
|
|
[TestFixture]
|
|
public class CurveDataListTests
|
|
{
|
|
protected const string ContentDirectory = @"Services\LeafOutputData\";
|
|
|
|
private static FileInfo GetContentFile(string fileName)
|
|
{
|
|
var path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, ContentDirectory);
|
|
return new FileInfo(path + fileName);
|
|
}
|
|
|
|
[Test]
|
|
public void Parse_Valid()
|
|
{
|
|
var fileInfo = GetContentFile("cntrlcomparison_Wild Capsicum.csv");
|
|
var cntrlComparison = new CurveDataList();
|
|
using (var reader = fileInfo.OpenText())
|
|
{
|
|
cntrlComparison.ReadFromStream(reader);
|
|
}
|
|
Assert.That(cntrlComparison.CurveData.Count, Is.EqualTo(7));
|
|
}
|
|
}
|
|
}
|