RogueEnumerable.cs 732 B

1234567891011121314151617181920212223242526272829
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the MIT License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Collections.Generic;
  6. namespace ReactiveTests.Tests
  7. {
  8. internal class RogueEnumerable<T> : IEnumerable<T>
  9. {
  10. private readonly Exception _ex;
  11. public RogueEnumerable(Exception ex)
  12. {
  13. _ex = ex;
  14. }
  15. public IEnumerator<T> GetEnumerator()
  16. {
  17. throw _ex;
  18. }
  19. System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
  20. {
  21. throw new NotImplementedException();
  22. }
  23. }
  24. }