Never.cs 716 B

12345678910111213141516171819202122232425262728
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Linq;
  6. using System.Threading.Tasks;
  7. using Xunit;
  8. namespace Tests
  9. {
  10. public class Never : AsyncEnumerableExTests
  11. {
  12. [Fact]
  13. public async Task Never1()
  14. {
  15. var xs = AsyncEnumerableEx.Never<int>();
  16. var e = xs.GetAsyncEnumerator();
  17. Assert.False(e.MoveNextAsync().IsCompleted); // Very rudimentary check
  18. await e.DisposeAsync();
  19. }
  20. private void Nop(object o)
  21. {
  22. }
  23. }
  24. }