Table of Contents

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 string
cancellationToken CancellationToken?
args object[]
resultType Type
invocationMethodName 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

identifier string
args object[]
resultType Type
invocationMethodName string

JSRuntimeInvocation(string, Type, string)

Initializes a new instance of the JSRuntimeInvocation struct.

public JSRuntimeInvocation(string identifier, Type resultType, string invocationMethodName)

Parameters

identifier string
resultType Type
invocationMethodName string

Properties

Arguments

Gets the arguments used in the invocation.

public IReadOnlyList<object?> Arguments { get; }

Property Value

IReadOnlyList<object>

CancellationToken

Gets the cancellation token used in the invocation, if any.

public CancellationToken? CancellationToken { get; }

Property Value

CancellationToken?

Identifier

Gets the identifier used in the invocation.

public string Identifier { get; }

Property Value

string

InvocationMethodName

Gets the name of the method that initiated the invocation, e.g. InvokeAsync or Invoke.

public string InvocationMethodName { get; }

Property Value

string

IsVoidResultInvocation

Gets whether the invocation has a void return type.

public bool IsVoidResultInvocation { get; }

Property Value

bool

ResultType

Gets the result type of the invocation. If IsVoidResultInvocation then this will be of type object.

public Type ResultType { get; }

Property Value

Type

Methods

Equals(JSRuntimeInvocation)

public bool Equals(JSRuntimeInvocation other)

Parameters

other JSRuntimeInvocation

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(JSRuntimeInvocation, JSRuntimeInvocation)

Verify whether left and right JSRuntimeInvocation is equal.

public static bool operator ==(JSRuntimeInvocation left, JSRuntimeInvocation right)

Parameters

left JSRuntimeInvocation
right JSRuntimeInvocation

Returns

bool

operator !=(JSRuntimeInvocation, JSRuntimeInvocation)

Verify whether left and right JSRuntimeInvocation is not equal.

public static bool operator !=(JSRuntimeInvocation left, JSRuntimeInvocation right)

Parameters

left JSRuntimeInvocation
right JSRuntimeInvocation

Returns

bool
Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.