MockDisposable.cs 722 B

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using Microsoft.Reactive.Testing;
  7. namespace ReactiveTests
  8. {
  9. public class MockDisposable : List<long>, IDisposable
  10. {
  11. TestScheduler scheduler;
  12. public MockDisposable(TestScheduler scheduler)
  13. {
  14. if (scheduler == null)
  15. throw new ArgumentNullException("scheduler");
  16. this.scheduler = scheduler;
  17. Add(scheduler.Clock);
  18. }
  19. public void Dispose()
  20. {
  21. Add(scheduler.Clock);
  22. }
  23. }
  24. }