/// <summary> /// Constructs a new test instruction executor. /// </summary> /// <param name="scheduler">Implementation for time and frame based operations.</param> /// <param name="externalResultSource"> /// Optional source for premature completion of test operations. /// </param> /// <param name="failureListener"> /// Optional failure listener, to get notifications on test operation failures. /// </param> /// <param name="globalContextProvider"> /// Optional provider for global context, which gets included in failure messages. /// </param> public TestInstructionExecutor( ITestScheduler scheduler, IExternalResultSource externalResultSource = null, IFailureListener failureListener = null, IGlobalContextProvider globalContextProvider = null) { this.scheduler = scheduler; this.externalResultSource = externalResultSource; this.failureListener = failureListener; this.globalContextProvider = globalContextProvider; }
/// <summary> /// Constructs a new test instruction executor. /// </summary> /// <param name="scheduler">Implementation for time and frame based operations.</param> /// <param name="externalResultSource"> /// Optional source for premature completion of test operations. /// </param> /// <param name="failureListener"> /// Optional failure listener, to get notifications on test operation failures. /// </param> /// <param name="globalContextProvider"> /// Optional provider for global context, which gets included in failure messages. /// </param> /// <param name="rethrowableExceptions"> /// Optional collection of exception types to rethrow, instead of wrapping them in /// <see cref="TestFailureException"/>. /// Test instructions terminating with any of the given exception types will be considered /// completed, and not failed. Can be used with e.g. NUnit's <c>IgnoreException</c>. /// </param> public TestInstructionExecutor( ITestScheduler scheduler, IExternalResultSource externalResultSource = null, IFailureListener failureListener = null, IGlobalContextProvider globalContextProvider = null, IReadOnlyList <Type> rethrowableExceptions = null) { this.scheduler = scheduler; this.externalResultSource = externalResultSource; this.failureListener = failureListener; this.globalContextProvider = globalContextProvider; this.rethrowableExceptions = rethrowableExceptions; }
private UnityTestInstructionExecutor( UnityTestScheduler scheduler, UnityErrorLogInterceptor errorLogInterceptor, bool logErrors, IGlobalContextProvider globalContextProvider) : base( scheduler, errorLogInterceptor, logErrors ? new UnityFailureListener() : null, globalContextProvider, new[] { typeof(IgnoreException), typeof(InconclusiveException), typeof(SuccessException), }) { this.scheduler = scheduler; this.errorLogInterceptor = errorLogInterceptor; }
/// <summary> /// Constructs a new TestInstructionExecutor with a default Unity configuration. /// If you are not using Responsible all the way, but also have some bare coroutines involved, /// you will probably want to also log any errors, in addition to failing the tests the normal way, /// as Unity has the tendency to swallow exceptions from nested coroutines. /// </summary> /// <param name="logErrors">Whether or not errors should be logged in addition to propagated.</param> /// <param name="globalContextProvider"> /// Optional provider for global context, which gets included in failure messages. /// </param> public UnityTestInstructionExecutor(bool logErrors = true, IGlobalContextProvider globalContextProvider = null) : this(UnityTestScheduler.Create(), new UnityErrorLogInterceptor(), logErrors, globalContextProvider) { }