Struct JSRuntimeInvocation
- Namespace
- Bunit
- Assembly
- Bunit.Web.dll
Represents an invocation of JavaScript via the JSRuntime Mock.
public readonly struct JSRuntimeInvocation : IEquatable<JSRuntimeInvocation>
- Implements
- Inherited Members
- Extension Methods
Constructors
JSRuntimeInvocation(string, CancellationToken?, object?[]?, Type, string)
Initializes a new instance of the JSRuntimeInvocation struct.
public JSRuntimeInvocation(string identifier, CancellationToken? cancellationToken, object?[]? args, Type resultType, string invocationMethodName)
Parameters
identifier
stringcancellationToken
CancellationToken?args
object[]resultType
TypeinvocationMethodName
string
JSRuntimeInvocation(string, object?[], Type, string)
Initializes a new instance of the JSRuntimeInvocation struct.
public JSRuntimeInvocation(string identifier, object?[] args, Type resultType, string invocationMethodName)
Parameters
JSRuntimeInvocation(string, Type, string)
Initializes a new instance of the JSRuntimeInvocation struct.
public JSRuntimeInvocation(string identifier, Type resultType, string invocationMethodName)
Parameters
Properties
Arguments
Gets the arguments used in the invocation.
public IReadOnlyList<object?> Arguments { get; }
Property Value
CancellationToken
Gets the cancellation token used in the invocation, if any.
public CancellationToken? CancellationToken { get; }
Property Value
Identifier
Gets the identifier used in the invocation.
public string Identifier { get; }
Property Value
InvocationMethodName
Gets the name of the method that initiated the invocation, e.g. InvokeAsync
or Invoke
.
public string InvocationMethodName { get; }
Property Value
IsVoidResultInvocation
Gets whether the invocation has a void
return type.
public bool IsVoidResultInvocation { get; }
Property Value
ResultType
Gets the result type of the invocation. If IsVoidResultInvocation then this will be of type object.
public Type ResultType { get; }
Property Value
Methods
Equals(JSRuntimeInvocation)
public bool Equals(JSRuntimeInvocation other)
Parameters
other
JSRuntimeInvocation
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(JSRuntimeInvocation, JSRuntimeInvocation)
Verify whether left
and right
JSRuntimeInvocation is equal.
public static bool operator ==(JSRuntimeInvocation left, JSRuntimeInvocation right)
Parameters
left
JSRuntimeInvocationright
JSRuntimeInvocation
Returns
operator !=(JSRuntimeInvocation, JSRuntimeInvocation)
Verify whether left
and right
JSRuntimeInvocation is not equal.
public static bool operator !=(JSRuntimeInvocation left, JSRuntimeInvocation right)
Parameters
left
JSRuntimeInvocationright
JSRuntimeInvocation