TestResultRendererCallback.cs 886 B

123456789101112131415161718192021222324252627282930313233343536
  1. using NUnit.Framework.Interfaces;
  2. namespace UnityEngine.TestTools.TestRunner.Callbacks
  3. {
  4. internal class TestResultRendererCallback : MonoBehaviour, ITestRunnerListener
  5. {
  6. private TestResultRenderer m_ResultRenderer;
  7. public void RunStarted(ITest testsToRun)
  8. {
  9. }
  10. public void RunFinished(ITestResult testResults)
  11. {
  12. if (Camera.main == null)
  13. {
  14. gameObject.AddComponent<Camera>();
  15. }
  16. m_ResultRenderer = new TestResultRenderer(testResults);
  17. m_ResultRenderer.ShowResults();
  18. }
  19. public void OnGUI()
  20. {
  21. if (m_ResultRenderer != null)
  22. m_ResultRenderer.Draw();
  23. }
  24. public void TestStarted(ITest test)
  25. {
  26. }
  27. public void TestFinished(ITestResult result)
  28. {
  29. }
  30. }
  31. }