public void testLoadFile() { StringTheory theory = new StringTheory(); Assert.True(theory.LoadFile(@"C:\Built\Products\StringTheory\1.4\C#\_development\StringTheory\Built\UnitTests\justify.txt"), "Couldn't load file?"); Assert.True(theory.Length > 0, "There should be some data in the file!"); Assert.True(theory.Lines().Length > 1, "There should be many lines in the file!"); }
public void testLineCount() { StringTheory theory = new StringTheory("Line 1\r\nLine 2\r\nLine 3\r\n"); StringTheory theory2 = new StringTheory("Line 1\nLine 2\nLine 3\n"); StringTheory theory3 = new StringTheory("Line 1\rLine 2\rLine 3\r"); StringTheory theory4 = new StringTheory("Line 1\r\nLine 2\r\nLine 3"); StringTheory theory5 = new StringTheory("Line 1\nLine 2\nLine 3"); StringTheory theory6 = new StringTheory("Line 1\rLine 2\rLine 3"); Assert.True((theory2.Lines().Length == 3) && (theory5.Lines().Length == 3), "Wrong line count in {unix}: "); Assert.True((theory3.Lines().Length == 3) && (theory6.Lines().Length == 3), "Wrong line count in {mac}: "); Assert.True((theory.Lines().Length == 3) && (theory4.Lines().Length == 3), "Wrong line count in {pc}: " + theory.Lines().Length); }