Skip to content

Commit

Permalink
Simplify helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
gunndabad committed Dec 19, 2024
1 parent 45940ff commit 130e72d
Showing 1 changed file with 1 addition and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ public static IReturnsResult<T> ReturnsAsyncEnumerable<T, TResult>(
params TResult[] items)
where T : class
{
return setup.Returns(GetAsyncEnumerableAsync(items));

#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
static async IAsyncEnumerable<R> GetAsyncEnumerableAsync<R>(IEnumerable<R> enumerable)
{
foreach (var item in enumerable)
{
yield return item;
}
}
#pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously
return setup.Returns(items.ToAsyncEnumerable());
}
}

0 comments on commit 130e72d

Please sign in to comment.