| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System.Collections.Generic; |
| | | 5 | | using System.Threading.Tasks; |
| | | 6 | | |
| | | 7 | | namespace Azure.Core.TestFramework |
| | | 8 | | { |
| | | 9 | | public static class TestAsyncEnumerableExtensions |
| | | 10 | | { |
| | | 11 | | public static async Task<List<T>> ToEnumerableAsync<T>(this IAsyncEnumerable<T> asyncEnumerable) |
| | | 12 | | { |
| | 2248 | 13 | | List<T> list = new List<T>(); |
| | 285232 | 14 | | await foreach (T item in asyncEnumerable) |
| | | 15 | | { |
| | 140368 | 16 | | list.Add(item); |
| | | 17 | | } |
| | 2248 | 18 | | return list; |
| | 2248 | 19 | | } |
| | | 20 | | } |
| | | 21 | | } |