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
actualArgumentobjectobject to verify.
expectedTargetElementIElementexpected 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
jsInteropBunitJSInteropThe bUnit JSInterop to verify against.
identifierstringIdentifier of invocation that should have been invoked.
calledTimesintThe number of times the invocation is expected to have been called.
userMessagestringA 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
jsInteropBunitJSInteropThe bUnit JSInterop to verify against.
identifierstringIdentifier of invocation that should have been invoked.
userMessagestringA 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
handlerJSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifierstringIdentifier of invocation that should have been invoked.
calledTimesintThe number of times the invocation is expected to have been called.
userMessagestringA 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
handlerJSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifierstringIdentifier of invocation that should have been invoked.
userMessagestringA 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
jsInteropBunitJSInteropThe bUnit JSInterop to verify against.
identifierstringIdentifier of invocation that should not have happened.
userMessagestringA 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
handlerJSRuntimeInvocationHandlerBase<TResult>Handler to verify against.
identifierstringIdentifier of invocation that should not have happened.
userMessagestringA custom user message to display if the assertion fails.
Type Parameters
TResult