Skip to content

Commit

Permalink
Fix FileModifierStep_Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Mar 23, 2023
1 parent b43cd73 commit 014e8be
Showing 1 changed file with 8 additions and 45 deletions.
53 changes: 8 additions & 45 deletions test/AbpHelper.Tests/Steps/FileModifierStep_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ public FileModifierStep_Tests(ITestOutputHelper output)
private readonly ITestOutputHelper _output;
private readonly FileModifierStep _step;

private const string DefaultFileContents = @"1
2
3
4
5
";
private const string DefaultFileContents = "1\r\n2\r\n3\r\n4\r\n5";

private async Task<string> UsingTempFile(string contents, Func<string, Task> action)
{
Expand Down Expand Up @@ -62,9 +57,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"4
5
");
contents.ShouldBe("4\r\n5\r\n");
});
});
}
Expand All @@ -86,13 +79,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"1
2
3
4
5
abc
");
contents.ShouldBe("1\r\n2\r\n3\r\n4\r\n5\r\nabc\r\n");
});
});
}
Expand All @@ -114,13 +101,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"abc
1
2
3
4
5
");
contents.ShouldBe("abc\r\n1\r\n2\r\n3\r\n4\r\n5\r\n");
});
});
}
Expand All @@ -146,14 +127,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"abc
def
1
2
3
4
5
");
contents.ShouldBe("abc\r\ndef\r\n1\r\n2\r\n3\r\n4\r\n5\r\n");
});
});
}
Expand Down Expand Up @@ -181,11 +155,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"a
1
b
5
c");
contents.ShouldBe("a\r\n1\r\nb\r\n5\r\nc");
});
});
}
Expand All @@ -212,11 +182,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"1
a
2
b
");
contents.ShouldBe("1\r\na\r\n2\r\nb\r\n");
});
});
}
Expand Down Expand Up @@ -346,10 +312,7 @@ await UsingTempFile(DefaultFileContents, async file =>
// Assert
var contents = await File.ReadAllTextAsync(file);
contents.ShouldBe(@"abc
4
5
");
contents.ShouldBe("abc\r\n4\r\n5\r\n");
});
});
}
Expand Down

0 comments on commit 014e8be

Please sign in to comment.