Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test updates to ignore \r\n vs. \n.

  • Loading branch information...
commit 90a817b783e116d4072054a82ee6627631ef4783 1 parent 753ab2f
@MikeStall authored
View
17 Sources/DataTableTests/AnalyzeTests.cs
@@ -41,11 +41,20 @@ MutableDataTable GetInMemoryTable()
return dt;
}
+ // Do string comparison, ignoring ignoring newline (\r\n vs just \n)
+ public static void AssertEquals(string content, string actual)
+ {
+ content = content.Replace("\r\n", "\n");
+ actual = actual.Replace("\r\n", "\n");
+ Assert.Equal(content, actual);
+ }
+
public static void AssertEquals(string content, DataTable dt)
{
StringWriter sw = new StringWriter();
dt.SaveToStream(sw);
- Assert.Equal(content, sw.ToString());
+ string actual = sw.ToString();
+ AssertEquals(content, actual);
}
[Fact]
@@ -153,16 +162,16 @@ public void ShredTest()
File.Delete(file1);
File.Delete(file2);
- Assert.Equal(
+ AnalyzeTests.AssertEquals(
@"first,last,age
Bob,Smith,12
Ed,Smith,12
John,Smith,34
", content1);
-
- Assert.Equal(
+
+ AnalyzeTests.AssertEquals(
@"first,last,age
Bob,Jones,34
", content2);
View
2  Sources/DataTableTests/DataTableTests.cs
@@ -19,7 +19,7 @@ public void SaveToCSV()
dt.SaveCSV(temp);
string content = File.ReadAllText(temp);
- Assert.Equal(
+ AnalyzeTests.AssertEquals(
@"value
10
20
View
2  Sources/DataTableTests/Tests.cs
@@ -125,7 +125,7 @@ public void ArrayToTable()
StringWriter sw = new StringWriter();
dt.SaveToStream(sw);
- Assert.Equal(
+ AnalyzeTests.AssertEquals(
@"x,y
11,12
21,22
Please sign in to comment.
Something went wrong with that request. Please try again.