• 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 UnityErrorLogInterceptor

Class used to replicate the Unity test runner behaviour of failing tests when either LogError(object) or LogException(Exception) is called.

Inheritance
object
UnityErrorLogInterceptor
Implements
IExternalResultSource
Namespace: Responsible.Unity
Assembly: Responsible.dll
Syntax
public class UnityErrorLogInterceptor : IExternalResultSource

Methods

ExpectLog(LogType, Regex)

Expect a log message during execution of any subsequent test instructions. Similar to Expect(LogType, Regex), but needs to be called instead of that, in order to work when executing test instructions.

Declaration
public void ExpectLog(LogType logType, Regex regex)
Parameters
Type Name Description
LogType logType

Log type to expect.

Regex regex

Regex to match the message to be expected.

Remarks

Will call Expect(LogType, Regex), so it doesn't need to be called separately.

GetExternalResult<T>(CancellationToken)

Intercept errors, respecting and not toggling the globally mutable UnityEngine.TestTools.LogAssert.ignoreFailingMessages. Will complete with an error if either an error or exception is logged, and will never complete if neither of those happens.

Declaration
public Task<T> GetExternalResult<T>(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken

Token used to cancel this operation.

Returns
Type Description
Task<T>

Task, which will complete with an error if either an error or exception is logged.

Type Parameters
Name Description
T

Type of the test operation being run.

Implements

IExternalResultSource
In this article
Back to top Generated by DocFX