• Home
  • .NET
  • Unity
  • Godot
  • Design Overview
  • API Documentation
  • Changelog
  • GitHub
Show / Hide Table of Contents
  • Responsible
    • BddExtensions
    • IExternalResultSource
    • IFailureListener
    • IGlobalContextProvider
    • IOptionalTestResponder
    • ITestInstruction<T>
    • ITestOperation<T>
    • ITestResponder<T>
    • ITestScheduler
    • ITestWaitCondition<T>
    • LinqSupport
    • OptionalTestResponder
    • RepetitionLimitExceededException
    • Responsibly
    • TestFailureException
    • TestInstruction
    • TestInstructionExecutor
    • TestInstructionExecutor.StateNotificationCallback
    • TestOperationState
    • TestResponder
    • TestWaitCondition
  • Responsible.Bdd
    • IBddStep
    • Keywords
    • ScenarioBuilder
  • Responsible.Context
    • RunContext
  • Responsible.Docs
    • Inherit
  • Responsible.State
    • ITestOperationState
    • ITestOperationState<T>
    • StateStringBuilder
    • TestOperationStateTransition
    • TestOperationStatus
  • Responsible.Unity
    • TestOperationYieldInstruction<T>
    • UnhandledLogMessageException
    • UnityErrorLogInterceptor
    • UnityFailureListener
    • UnityTestInstructionExecutor
    • UnityTestScheduler
  • Responsible.Utilities
    • IMultipleTaskAwaiter<T>
    • IMultipleTaskSource<T>
    • IndentedStringBuilder<T>
    • RetryingPoller

Class TestInstructionExecutor

Handles execution of test instructions, external result sources, and failure notifications.

Inheritance
object
TestInstructionExecutor
UnityTestInstructionExecutor
Implements
IDisposable
Namespace: Responsible
Assembly: Responsible.dll
Syntax
[PublicAPI]
public class TestInstructionExecutor : IDisposable
Remarks

It is recommended to use a base class for your tests using Responsible, which sets up and disposes the test instruction executor.

Constructors

TestInstructionExecutor(ITestScheduler, IExternalResultSource, IFailureListener, IGlobalContextProvider, IReadOnlyList<Type>)

Constructs a new test instruction executor.

Declaration
public TestInstructionExecutor(ITestScheduler scheduler, IExternalResultSource externalResultSource = null, IFailureListener failureListener = null, IGlobalContextProvider globalContextProvider = null, IReadOnlyList<Type> rethrowableExceptions = null)
Parameters
Type Name Description
ITestScheduler scheduler

Implementation for time and frame based operations.

IExternalResultSource externalResultSource

Optional source for premature completion of test operations.

IFailureListener failureListener

Optional failure listener, to get notifications on test operation failures.

IGlobalContextProvider globalContextProvider

Optional provider for global context, which gets included in failure messages.

IReadOnlyList<Type> rethrowableExceptions

Optional collection of exception types to rethrow, instead of wrapping them in 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 IgnoreException.

Methods

Dispose()

Disposes the executor. For extra safety, it is recommended to construct a new executor for each test, and dispose it after the test has finished.

Declaration
public virtual void Dispose()

SubscribeToStates(StateNotificationCallback)

Will call callback when operations start or finish.

Declaration
public static IDisposable SubscribeToStates(TestInstructionExecutor.StateNotificationCallback callback)
Parameters
Type Name Description
TestInstructionExecutor.StateNotificationCallback callback

Callback to call when an operation starts or finishes.

Returns
Type Description
IDisposable

A disposable, which will remove the callback when disposed.

Remarks

Static, so that Unity EditorWindows can access it. Used by the test operation window available in Unity at Window/Responsible/Operation State.

Implements

IDisposable

Extension Methods

BddExtensions.RunScenario(TestInstructionExecutor, ScenarioBuilder, params IBddStep[])
In this article
Back to top Generated by DocFX