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.

67 lines
1.6KB

  1. using System;
  2. using HarmonyLib;
  3. using RobocraftX.Services;
  4. using TechbloxModdingAPI.Tests;
  5. namespace TechbloxModdingAPI.App
  6. {
  7. #if TEST
  8. /// <summary>
  9. /// Client popups tests.
  10. /// Only available in TEST builds.
  11. /// </summary>
  12. [APITestClass]
  13. public static class ClientAlertTest
  14. {
  15. private static DualChoicePrompt popup2 = null;
  16. private static SingleChoicePrompt popup1 = null;
  17. [APITestStartUp]
  18. public static void StartUp2()
  19. {
  20. popup2 = new DualChoicePrompt("This is a test double-button popup",
  21. "The cake is a lie",
  22. "lmao",
  23. () => { },
  24. "kek",
  25. () => { });
  26. }
  27. [APITestStartUp]
  28. public static void StartUp1()
  29. {
  30. popup1 = new SingleChoicePrompt("The cake is a lie",
  31. "This is a test single-button popup",
  32. "qwertyuiop",
  33. () => { });
  34. }
  35. [APITestCase(TestType.Menu)]
  36. public static void TestPopUp2()
  37. {
  38. Client.Instance.PromptUser(popup2);
  39. }
  40. [APITestCase(TestType.Menu)]
  41. public static void TestPopUp1()
  42. {
  43. Client.Instance.PromptUser(popup1);
  44. }
  45. [APITestCase(TestType.Menu)]
  46. public static void TestPopUpClose1()
  47. {
  48. Client.Instance.CloseCurrentPrompt();
  49. }
  50. [APITestCase(TestType.Menu)]
  51. public static void TestPopUpClose2()
  52. {
  53. Client.Instance.CloseCurrentPrompt();
  54. }
  55. }
  56. #endif
  57. }