UnhandledLogMessageException.cs 985 B

1234567891011121314151617181920212223242526272829303132333435
  1. using NUnit.Framework;
  2. using NUnit.Framework.Interfaces;
  3. using UnityEngine.TestTools.Logging;
  4. using UnityEngine.TestTools.Utils;
  5. namespace UnityEngine.TestTools.TestRunner
  6. {
  7. internal class UnhandledLogMessageException : ResultStateException
  8. {
  9. public LogEvent LogEvent;
  10. private readonly string m_CustomStackTrace;
  11. public UnhandledLogMessageException(LogEvent log)
  12. : base(BuildMessage(log))
  13. {
  14. LogEvent = log;
  15. m_CustomStackTrace = StackTraceFilter.Filter(log.StackTrace);
  16. }
  17. private static string BuildMessage(LogEvent log)
  18. {
  19. return string.Format("Unhandled log message: '{0}'. Use UnityEngine.TestTools.LogAssert.Expect", log);
  20. }
  21. public override ResultState ResultState
  22. {
  23. get { return ResultState.Failure; }
  24. }
  25. public override string StackTrace
  26. {
  27. get { return m_CustomStackTrace; }
  28. }
  29. }
  30. }