Skip to content

Commit

Permalink
Fix line endings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fakefeik committed Jan 30, 2019
1 parent 838199f commit aa62938
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions TypeScript.ContractGenerator.Tests/EndToEndTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public EndToEndTests(JavaScriptTypeChecker javaScriptTypeChecker)
[TestCase(typeof(NotNullRootType), "notnull-types.expected")]
public void GenerateCodeTest(Type rootType, string expectedFileName)
{
var generatedCode = GenerateCode(rootType).Single();
var generatedCode = GenerateCode(rootType).Single().Replace("\r\n", "\n");
var expectedCode = File.ReadAllText(GetFilePath($"SimpleGenerator/{expectedFileName}")).Replace("\r\n", "\n");
generatedCode.Should().Be(expectedCode);
}
Expand All @@ -49,7 +49,7 @@ public void GenerateFilesTest(Type type)
[TestCase(typeof(ArrayRootType), "array-types.expected")]
public void CustomGeneratorTest(Type rootType, string expectedFileName)
{
var generatedCode = GenerateCode(new CustomTypeGenerator(), rootType).Single();
var generatedCode = GenerateCode(new CustomTypeGenerator(), rootType).Single().Replace("\r\n", "\n");
var expectedCode = File.ReadAllText(GetFilePath($"CustomGenerator/{expectedFileName}")).Replace("\r\n", "\n");
generatedCode.Should().Be(expectedCode);
}
Expand Down
6 changes: 5 additions & 1 deletion TypeScript.ContractGenerator.Tests/FlowTypeTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ private static void CheckDirectoriesEquivalenceInner(string expectedDirectory, s
actualFiles.Should().BeEquivalentTo(expectedFiles);

foreach (var filename in expectedFiles)
File.ReadAllText($"{actualDirectory}/{filename}").Should().Be(File.ReadAllText($"{expectedDirectory}/{filename}"));
{
var expected = File.ReadAllText($"{expectedDirectory}/{filename}").Replace("\r\n", "\n");
var actual = File.ReadAllText($"{actualDirectory}/{filename}").Replace("\r\n", "\n");
actual.Should().Be(expected);
}

var expectedDirectories = Directory.EnumerateDirectories(expectedDirectory).Select(Path.GetFileName).ToArray();
var actualDirectories = Directory.EnumerateDirectories(actualDirectory).Select(Path.GetFileName).ToArray();
Expand Down

0 comments on commit aa62938

Please sign in to comment.