forked from nissl-lab/toxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change MSUnit to NUnit to enable unittest on mono
- Loading branch information
Showing
18 changed files
with
202 additions
and
64 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using NUnit.Framework; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace Toxy.Test | ||
{ | ||
[TestFixture] | ||
public class ExcelTextParserTest | ||
{ | ||
[Test] | ||
public void TestExcel2003TextParser() | ||
{ | ||
ParserContext context = new ParserContext(TestDataSample.GetExcelPath("Employee.xls")); | ||
ITextParser parser = ParserFactory.CreateText(context); | ||
string result= parser.Parse(); | ||
Assert.IsNotNull(result); | ||
Assert.IsTrue(result.IndexOf("Last name")>0); | ||
Assert.IsTrue(result.IndexOf("First name") > 0); | ||
} | ||
[Test] | ||
public void TestExcel2007TextParser() | ||
{ | ||
ParserContext context = new ParserContext(TestDataSample.GetExcelPath("WithVariousData.xlsx")); | ||
ITextParser parser = ParserFactory.CreateText(context); | ||
string result = parser.Parse(); | ||
Assert.IsNotNull(result); | ||
Assert.IsTrue(result.IndexOf("Foo") > 0); | ||
Assert.IsTrue(result.IndexOf("Bar") > 0); | ||
Assert.IsTrue(result.IndexOf("a really long cell") > 0); | ||
|
||
Assert.IsTrue(result.IndexOf("have a header") > 0); | ||
Assert.IsTrue(result.IndexOf("have a footer") > 0); | ||
Assert.IsTrue(result.IndexOf("This is the header") < 0); | ||
} | ||
[Test] | ||
public void TestExcel2007TextParserWithoutComment() | ||
{ | ||
ParserContext context = new ParserContext(TestDataSample.GetExcelPath("WithVariousData.xlsx")); | ||
context.Properties.Add("IncludeComments","0"); | ||
ITextParser parser = ParserFactory.CreateText(context); | ||
string result = parser.Parse(); | ||
Assert.IsNotNull(result); | ||
Assert.IsTrue(result.IndexOf("Comment by") < 0); | ||
} | ||
[Test] | ||
public void TestExcel2007TextParserWithoutSheetNames() | ||
{ | ||
ParserContext context = new ParserContext(TestDataSample.GetExcelPath("WithVariousData.xlsx")); | ||
context.Properties.Add("IncludeSheetNames", "0"); | ||
ITextParser parser = ParserFactory.CreateText(context); | ||
string result = parser.Parse(); | ||
Assert.IsNotNull(result); | ||
Assert.IsTrue(result.IndexOf("Sheet1") < 0); | ||
} | ||
[Test] | ||
public void TestExcel2007TextParserWithHeaderFooter() | ||
{ | ||
ParserContext context = new ParserContext(TestDataSample.GetExcelPath("WithVariousData.xlsx")); | ||
context.Properties.Add("IncludeHeaderFooter", "1"); | ||
ITextParser parser = ParserFactory.CreateText(context); | ||
string result = parser.Parse(); | ||
Assert.IsNotNull(result); | ||
Assert.IsTrue(result.IndexOf("This is the header") > 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.