TestPlatform.cs 753 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. namespace UnityEngine.TestTools
  3. {
  4. /// <summary>
  5. /// A flag indicating the targeted test platforms.
  6. /// </summary>
  7. [Flags]
  8. [Serializable]
  9. public enum TestPlatform : byte
  10. {
  11. /// <summary>
  12. /// Both platforms.
  13. /// </summary>
  14. All = 0xFF,
  15. /// <summary>
  16. /// The EditMode test platform.
  17. /// </summary>
  18. EditMode = 1 << 1,
  19. /// <summary>
  20. /// The PlayMode test platform.
  21. /// </summary>
  22. PlayMode = 1 << 2
  23. }
  24. internal static class TestPlatformEnumExtensions
  25. {
  26. public static bool IsFlagIncluded(this TestPlatform flags, TestPlatform flag)
  27. {
  28. return (flags & flag) == flag;
  29. }
  30. }
  31. }