Add base directory for unit tests, since new resharper runs them else where
This commit is contained in:
@@ -11,12 +11,18 @@ namespace LeafWeb.Core.Tests.Services
|
||||
[TestFixture]
|
||||
public class LeafInputCsvParserTests
|
||||
{
|
||||
private const string LeafInputFolder = @"Services\LeafInputData\";
|
||||
protected const string ContentDirectory = @"Services\LeafInputData\";
|
||||
|
||||
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 = new FileInfo(LeafInputFolder + "LeafInput-valid.csv");
|
||||
var fileInfo = GetContentFile("LeafInput-valid.csv");
|
||||
var leafInput = new LeafInputCsvParser(fileInfo);
|
||||
var input = leafInput.Parse();
|
||||
|
||||
@@ -102,7 +108,7 @@ namespace LeafWeb.Core.Tests.Services
|
||||
[Test]
|
||||
public void Parse_TitlesRemoved()
|
||||
{
|
||||
var fileInfo = new FileInfo(LeafInputFolder + "LeafInput-titlesRemoved.csv");
|
||||
var fileInfo = GetContentFile("LeafInput-titlesRemoved.csv");
|
||||
var leafInput = new LeafInputCsvParser(fileInfo);
|
||||
var input = leafInput.Parse();
|
||||
|
||||
@@ -121,7 +127,7 @@ namespace LeafWeb.Core.Tests.Services
|
||||
[Test]
|
||||
public void Parse_IncompleteRows()
|
||||
{
|
||||
var fileInfo = new FileInfo(LeafInputFolder + "LeafInput-incompleteRows.csv");
|
||||
var fileInfo = GetContentFile("LeafInput-incompleteRows.csv");
|
||||
var parser = new LeafInputCsvParser(fileInfo);
|
||||
Assert.That(() => parser.Parse(), Throws.TypeOf<ParseException>());
|
||||
}
|
||||
@@ -129,7 +135,7 @@ namespace LeafWeb.Core.Tests.Services
|
||||
[Test]
|
||||
public void Parse_NoData()
|
||||
{
|
||||
var fileInfo = new FileInfo(LeafInputFolder + "LeafInput-noData.csv");
|
||||
var fileInfo = GetContentFile("LeafInput-noData.csv");
|
||||
var parser = new LeafInputCsvParser(fileInfo);
|
||||
var input = parser.Parse();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user