This file contains hidden or 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
| async Task Transform(Func<string, string> transform) | |
| { | |
| var tmp = Path.GetTempFileName(); | |
| await using var writer = new StreamWriter(tmp, false); | |
| using var reader = new StreamReader(FileName); | |
| var line = await reader.ReadLineAsync(); | |
| while (line != null) | |
| { | |
| var newLine = transform(line); |
This file contains hidden or 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
| public static class TestExtensions | |
| { | |
| public static string ReadResource(this Assembly assembly, string name) | |
| { | |
| // Determine path | |
| var resourcePath = assembly.GetManifestResourceNames() | |
| .Single(str => str.EndsWith(name));; | |
| using (var stream = assembly.GetManifestResourceStream(resourcePath)) |