Table of Contents

Class JSRuntimeInvocationHandler<TResult>

Namespace
Bunit
Assembly
Bunit.Web.dll

Represents a handler for an invocation of a JavaScript function with specific arguments and returns TResult.

public class JSRuntimeInvocationHandler<TResult> : JSRuntimeInvocationHandlerBase<TResult>

Type Parameters

TResult

The expect result type.

Inheritance
JSRuntimeInvocationHandler<TResult>
Inherited Members
Extension Methods

Constructors

JSRuntimeInvocationHandler(InvocationMatcher, bool)

Initializes a new instance of the JSRuntimeInvocationHandler<TResult> class.

protected JSRuntimeInvocationHandler(InvocationMatcher matcher, bool isCatchAllHandler)

Parameters

matcher InvocationMatcher

An invocation matcher used to determine if the handler should handle an invocation.

isCatchAllHandler bool

Set to true if this handler is a catch all handler, that should only be used if there are no other non-catch all handlers available.

Methods

SetCanceled()

Marks the Task<TResult> that invocations will receive as canceled.

public JSRuntimeInvocationHandler<TResult> SetCanceled()

Returns

JSRuntimeInvocationHandler<TResult>

This handler to allow calls to be chained.

SetException<TException>(TException)

Sets the TException exception that invocations will receive.

public JSRuntimeInvocationHandler<TResult> SetException<TException>(TException exception) where TException : Exception

Parameters

exception TException

The exception to set.

Returns

JSRuntimeInvocationHandler<TResult>

This handler to allow calls to be chained.

Type Parameters

TException

SetResult(TResult)

Sets the TResult result that invocations will receive.

public JSRuntimeInvocationHandler<TResult> SetResult(TResult result)

Parameters

result TResult

The result to pass to callers.

Returns

JSRuntimeInvocationHandler<TResult>

This handler to allow calls to be chained.

.NET Foundation

Supported by the .NET Foundation.