PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/src/NUnit/core/Builders/CombiningStrategy.cs

#
C# | 49 lines | 36 code | 8 blank | 5 comment | 3 complexity | 6383019147452213d934ec86ad536e47 MD5 | raw file
Possible License(s): GPL-2.0
  1. // ****************************************************************
  2. // Copyright 2008, Charlie Poole
  3. // This is free software licensed under the NUnit license. You may
  4. // obtain a copy of the license at http://nunit.org.
  5. // ****************************************************************
  6. using System;
  7. using System.Collections;
  8. using System.Reflection;
  9. using NUnit.Core.Extensibility;
  10. namespace NUnit.Core.Builders
  11. {
  12. public abstract class CombiningStrategy
  13. {
  14. protected IDataPointProvider dataPointProvider =
  15. (IDataPointProvider)CoreExtensions.Host.GetExtensionPoint("DataPointProviders");
  16. private IEnumerable[] sources;
  17. private IEnumerator[] enumerators;
  18. public CombiningStrategy(IEnumerable[] sources)
  19. {
  20. this.sources = sources;
  21. }
  22. public IEnumerable[] Sources
  23. {
  24. get { return sources; }
  25. }
  26. public IEnumerator[] Enumerators
  27. {
  28. get
  29. {
  30. if (enumerators == null)
  31. {
  32. enumerators = new IEnumerator[Sources.Length];
  33. for (int i = 0; i < Sources.Length; i++)
  34. enumerators[i] = Sources[i].GetEnumerator();
  35. }
  36. return enumerators;
  37. }
  38. }
  39. public abstract IEnumerable GetTestCases();
  40. }
  41. }