A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.6KB

  1. using System;
  2. namespace GamecraftModdingAPI.Tests
  3. {
  4. /// <summary>
  5. /// Test type.
  6. /// When provided to APITestCaseAttribute, this dictates when the test case is called.
  7. /// </summary>
  8. public enum TestType
  9. {
  10. Menu,
  11. Game,
  12. SimulationMode,
  13. EditMode,
  14. }
  15. /// <summary>
  16. /// API Test Class attribute.
  17. /// Classes without this attribute will be ignored when searching for test cases.
  18. /// </summary>
  19. [AttributeUsage(AttributeTargets.Class)]
  20. public class APITestClassAttribute : Attribute
  21. {
  22. internal string Name;
  23. public APITestClassAttribute(string name = "")
  24. {
  25. this.Name = name;
  26. }
  27. }
  28. /// <summary>
  29. /// API Test Case attribute.
  30. /// Static methods with this attribute will be called when the API test system is running.
  31. /// </summary>
  32. [AttributeUsage(AttributeTargets.Method)]
  33. public class APITestCaseAttribute : Attribute
  34. {
  35. internal TestType TestType;
  36. public APITestCaseAttribute(TestType testType)
  37. {
  38. this.TestType = testType;
  39. }
  40. }
  41. /// <summary>
  42. /// API Test StartUp attribute.
  43. /// Static methods with this attribute will be called before any test case is run by the API test system.
  44. /// </summary>
  45. [AttributeUsage(AttributeTargets.Method)]
  46. public class APITestStartUpAttribute : Attribute
  47. {
  48. }
  49. /// <summary>
  50. /// API Test TearDown attribute.
  51. /// Static methods with this attribute will be called after all API test system test cases have completed (failed or succeeded).
  52. /// </summary>
  53. [AttributeUsage(AttributeTargets.Method)]
  54. public class APITestTearDownAttribute : Attribute
  55. {
  56. }
  57. }