No Description
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.

FailCommand.cs 978B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections;
  3. using NUnit.Framework.Interfaces;
  4. using NUnit.Framework.Internal;
  5. using NUnit.Framework.Internal.Commands;
  6. namespace UnityEngine.TestRunner.NUnitExtensions.Runner
  7. {
  8. internal class FailCommand : TestCommand, IEnumerableTestMethodCommand
  9. {
  10. private ResultState m_ResultState;
  11. private string m_Message;
  12. public FailCommand(Test test, ResultState resultState, string message)
  13. : base(test)
  14. {
  15. m_ResultState = resultState;
  16. m_Message = message;
  17. }
  18. public override TestResult Execute(ITestExecutionContext context)
  19. {
  20. context.CurrentResult.SetResult(m_ResultState, m_Message);
  21. return context.CurrentResult;
  22. }
  23. public IEnumerable ExecuteEnumerable(ITestExecutionContext context)
  24. {
  25. context.CurrentResult.SetResult(m_ResultState, m_Message);
  26. yield return null;
  27. }
  28. }
  29. }