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
-
JSRuntimeInvocationHandlerBase<TResult>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
InvocationMatcherAn invocation matcher used to determine if the handler should handle an invocation.
isCatchAllHandler
boolSet 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
TExceptionThe 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
TResultThe result to pass to callers.
Returns
- JSRuntimeInvocationHandler<TResult>
This handler to allow calls to be chained.