RemoteTestResultData.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using NUnit.Framework.Interfaces;
  5. namespace UnityEngine.TestRunner.TestLaunchers
  6. {
  7. [Serializable]
  8. internal class RemoteTestResultData
  9. {
  10. public string testId;
  11. public string name;
  12. public string fullName;
  13. public string resultState;
  14. public TestStatus testStatus;
  15. public double duration;
  16. public DateTime startTime;
  17. public DateTime endTime;
  18. public string message;
  19. public string stackTrace;
  20. public int assertCount;
  21. public int failCount;
  22. public int passCount;
  23. public int skipCount;
  24. public int inconclusiveCount;
  25. public bool hasChildren;
  26. public string output;
  27. public string xml;
  28. public string[] childrenIds;
  29. internal RemoteTestResultData(ITestResult result)
  30. {
  31. testId = result.Test.Id;
  32. name = result.Name;
  33. fullName = result.FullName;
  34. resultState = result.ResultState.ToString();
  35. testStatus = result.ResultState.Status;
  36. duration = result.Duration;
  37. startTime = result.StartTime;
  38. endTime = result.EndTime;
  39. message = result.Message;
  40. stackTrace = result.StackTrace;
  41. assertCount = result.AssertCount;
  42. failCount = result.FailCount;
  43. passCount = result.PassCount;
  44. skipCount = result.SkipCount;
  45. inconclusiveCount = result.InconclusiveCount;
  46. hasChildren = result.HasChildren;
  47. output = result.Output;
  48. xml = result.ToXml(true).OuterXml;
  49. childrenIds = result.Children.Select(child => child.Test.Id).ToArray();
  50. }
  51. }
  52. }