diff --git a/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/MockExtensions.cs b/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/MockExtensions.cs index b2e3a1520..d3daf0854 100644 --- a/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/MockExtensions.cs +++ b/TeachingRecordSystem/tests/TeachingRecordSystem.TestCommon/MockExtensions.cs @@ -9,16 +9,6 @@ public static IReturnsResult ReturnsAsyncEnumerable( 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 GetAsyncEnumerableAsync(IEnumerable 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()); } }