Created
February 9, 2025 15:52
-
-
Save fingers10/edc1108390ef4363d204977c88fc8b82 to your computer and use it in GitHub Desktop.
Processing Test File
This file contains 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
static async Task ProcessWithRegex(string filePath) | |
{ | |
var lines = await File.ReadAllLinesAsync(filePath); | |
var updatedLines = new StringBuilder(); | |
var converted = false; | |
foreach (var line in lines) | |
{ | |
if (line.Contains(".Should().")) | |
{ | |
var result = ConvertFluentAssertionsToXUnit(line); | |
updatedLines.AppendLine(result); | |
converted = true; | |
} | |
else | |
{ | |
updatedLines.AppendLine(line); | |
} | |
} | |
if (converted) | |
await File.WriteAllTextAsync(filePath, updatedLines.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment