Skip to content

Commit

Permalink
Suppressed CA2007 on a unit test warning that was preventing CI builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxisoft committed May 4, 2024
1 parent 411fdaa commit 45831a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ASFFreeGames.Tests/Reddit/RedditHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ public async Task TestDlcParsing() {
private static async Task<RedditGameEntry[]> LoadAsfinfoEntries() {
Assembly assembly = Assembly.GetExecutingAssembly();

#pragma warning disable CA2007
await using Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.ASFinfo.json")!;
#pragma warning restore CA2007
JsonNode jsonNode = await JsonNode.ParseAsync(stream).ConfigureAwait(false) ?? JsonNode.Parse("{}")!;

return RedditHelper.LoadMessages(jsonNode["data"]?["children"]!);
}

private static async Task<string> ReadToEndAsync(Stream stream, CancellationToken cancellationToken) {
using StreamReader reader = new StreamReader(stream);
using StreamReader reader = new(stream);

return await reader.ReadToEndAsync(cancellationToken).ConfigureAwait(false);
}
Expand Down

0 comments on commit 45831a7

Please sign in to comment.