diff --git a/PgpCore.Tests/UnitTests/UnitTestsAsync.cs b/PgpCore.Tests/UnitTests/UnitTestsAsync.cs index ad81815..f75fda5 100644 --- a/PgpCore.Tests/UnitTests/UnitTestsAsync.cs +++ b/PgpCore.Tests/UnitTests/UnitTestsAsync.cs @@ -786,7 +786,15 @@ public async Task VerifyAsync_DoNotVerifySignedFileWithBadContent(KeyType keyTyp await pgp.SignFileAsync(testFactory.ContentFilePath, testFactory.EncryptedContentFilePath); string[] fileLines = await File.ReadAllLinesAsync(testFactory.EncryptedContentFilePath); fileLines[3] = fileLines[3].Substring(0, fileLines[3].Length - 1 - 1) + "x"; - await File.WriteAllLinesAsync(testFactory.EncryptedContentFilePath, fileLines); + + using (StreamWriter streamWriter = new StreamWriter(testFactory.EncryptedContentFilePath)) + { + foreach (string line in fileLines) + { + streamWriter.WriteLine(line); + } + } + Func> action = async () => await pgp.VerifyFileAsync(testFactory.EncryptedContentFilePath); // Assert