Class JSRuntimeAssertExtensions
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Assert extensions for JSRuntimeMock.
public static class JSRuntimeAssertExtensions
- Inheritance
-
JSRuntimeAssertExtensions
- Inherited Members
Methods
ShouldBeElementReferenceTo(object?, IElement)
Verifies that an argument actualArgument
passed to an JSRuntime invocation is an ElementReference
to the expectedTargetElement
.
public static void ShouldBeElementReferenceTo(this object? actualArgument, IElement expectedTargetElement)
Parameters
actualArgument
objectobject to verify.
expectedTargetElement
IElementexpected targeted element.
VerifyInvoke(BunitJSInterop, string, int, string?)
Verifies that the identifier
has been invoked calledTimes
times.
public static IReadOnlyList<JSRuntimeInvocation> VerifyInvoke(this BunitJSInterop jsInterop, string identifier, int calledTimes, string? userMessage = null)
Parameters
jsInterop
BunitJSInteropThe bUnit JSInterop to verify against.
identifier
stringIdentifier of invocation that should have been invoked.
calledTimes
intThe number of times the invocation is expected to have been called.
userMessage
stringA custom user message to display if the assertion fails.
Returns
VerifyInvoke(BunitJSInterop, string, string?)
Verifies that the identifier
has been invoked one time.
public static JSRuntimeInvocation VerifyInvoke(this BunitJSInterop jsInterop, string identifier, string? userMessage = null)
Parameters
jsInterop
BunitJSInteropThe bUnit JSInterop to verify against.
identifier
stringIdentifier of invocation that should have been invoked.
userMessage
stringA custom user message to display if the assertion fails.
Returns
VerifyInvoke<TResult>(JSRuntimeInvocationHandlerBase<TResult>, string, int, string?)
Verifies that the identifier
has been invoked calledTimes
times.
public static IReadOnlyList<JSRuntimeInvocation> VerifyInvoke<TResult>(this JSRuntimeInvocationHandlerBase<TResult> handler, string identifier, int calledTimes, string? userMessage = null)
Parameters
handler
JSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifier
stringIdentifier of invocation that should have been invoked.
calledTimes
intThe number of times the invocation is expected to have been called.
userMessage
stringA custom user message to display if the assertion fails.
Returns
Type Parameters
TResult
VerifyInvoke<TResult>(JSRuntimeInvocationHandlerBase<TResult>, string, string?)
Verifies that the identifier
has been invoked one time.
public static JSRuntimeInvocation VerifyInvoke<TResult>(this JSRuntimeInvocationHandlerBase<TResult> handler, string identifier, string? userMessage = null)
Parameters
handler
JSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifier
stringIdentifier of invocation that should have been invoked.
userMessage
stringA custom user message to display if the assertion fails.
Returns
Type Parameters
TResult
VerifyNotInvoke(BunitJSInterop, string, string?)
Verifies that the identifier
was never invoked on the jsInterop
.
public static void VerifyNotInvoke(this BunitJSInterop jsInterop, string identifier, string? userMessage = null)
Parameters
jsInterop
BunitJSInteropThe bUnit JSInterop to verify against.
identifier
stringIdentifier of invocation that should not have happened.
userMessage
stringA custom user message to display if the assertion fails.
VerifyNotInvoke<TResult>(JSRuntimeInvocationHandlerBase<TResult>, string, string?)
Verifies that the identifier
was never invoked on the handler
.
public static void VerifyNotInvoke<TResult>(this JSRuntimeInvocationHandlerBase<TResult> handler, string identifier, string? userMessage = null)
Parameters
handler
JSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifier
stringIdentifier of invocation that should not have happened.
userMessage
stringA custom user message to display if the assertion fails.
Type Parameters
TResult