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.

36 lines
960B

  1. using System;
  2. using TechbloxModdingAPI.Tests;
  3. namespace TechbloxModdingAPI.App
  4. {
  5. #if TEST
  6. /// <summary>
  7. /// App callbacks tests.
  8. /// Only available in TEST builds.
  9. /// </summary>
  10. [APITestClass]
  11. public static class AppCallbacksTest
  12. {
  13. [APITestStartUp]
  14. public static void StartUp()
  15. {
  16. // this could be split into 6 separate test cases
  17. Game.Enter += Assert.CallsBack<GameEventArgs>("GameEnter");
  18. Game.Exit += Assert.CallsBack<GameEventArgs>("GameExit");
  19. Game.Simulate += Assert.CallsBack<GameEventArgs>("GameSimulate");
  20. Game.Edit += Assert.CallsBack<GameEventArgs>("GameEdit");
  21. Client.EnterMenu += Assert.CallsBack<MenuEventArgs>("MenuEnter");
  22. Client.ExitMenu += Assert.CallsBack<MenuEventArgs>("MenuExit");
  23. }
  24. [APITestCase(TestType.Game)]
  25. public static void Test()
  26. {
  27. // the test is actually completely implemented in StartUp()
  28. // this is here just so it looks less weird (not required)
  29. }
  30. }
  31. #endif
  32. }