GameActionsControllerTests.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using NUnit.Framework;
  4. using UnityEngine;
  5. using UnityEngine.TestTools;
  6. using KairoEngine.Core;
  7. using KairoEngine.Core.GameActions;
  8. namespace KairoEngine.Core.EditorTests.GameActions
  9. {
  10. public class GameActionsControllerTests
  11. {
  12. [Test]
  13. public void GameActionsController_HasActionListTest()
  14. {
  15. GameActionsController controller = new GameActionsController();
  16. Assert.NotNull(controller.actions, "GameActionsController action list is Null.");
  17. }
  18. [UnityTest]
  19. public IEnumerator GameActionsController_DuplicationTest()
  20. {
  21. LogAssert.Expect(LogType.Log, "Hello world");
  22. GameActionsController controller = new GameActionsController();
  23. DebugLogGameAction debugAction = new DebugLogGameAction(controller);
  24. debugAction.message = "Hello world";
  25. controller.actions.Add(debugAction);
  26. try
  27. {
  28. GameActionsController duplicatedController = controller.Duplicate();
  29. duplicatedController.Start();
  30. }
  31. catch (System.Exception e)
  32. {
  33. Debug.LogError(e);
  34. throw;
  35. }
  36. yield return null;
  37. yield return null;
  38. yield return null;
  39. }
  40. }
  41. }