InMemoryViewTransport class

Namespace Runic.Application.Testing · Runic.Application.Testing 0.7.0-preview.5

public sealed class InMemoryViewTransport : IBridgeTransport, IDisposable

Inherits or implements IBridgeTransport, IDisposable.

In-memory implementation of the same host-neutral route boundary used by browser adapters. Calls invoke real generated handlers; no native UI runs.

Constructors

InMemoryViewTransport

public InMemoryViewTransport()

No documentation.

Properties

Routes

public IReadOnlyList<string> Routes { get; }

Names of currently bound routes.

Methods

Bind

public IDisposable Bind(string name, Func<IBridgeArguments, string> handler)

Binds a synchronous browser route.

Returns

A lease that unbinds the route.

Documentation from IBridgeTransport.Bind.

BindAsync

public IDisposable BindAsync(string name, Func<IBridgeArguments, CancellationToken, ValueTask<string>> handler)

Binds an asynchronous browser route.

Returns

A lease that unbinds the route.

Documentation from IBridgeTransport.BindAsync.

Call

public string Call(string name, ViewTestArguments? arguments = null)

Calls a synchronous generated route.

CallAsync

public ValueTask<string> CallAsync(string name, ViewTestArguments? arguments = null, CancellationToken cancellationToken = default)

Calls an asynchronous generated route and observes its result.

Dispose

public void Dispose()

Removes all routes and recorded publications.

DrainPublications

public IReadOnlyList<ViewTestPublication> DrainPublications()

Returns and clears publications since the previous drain.

Publish

public void Publish(string name, string stateJson)

Records a state publication for InMemoryViewTransport.DrainPublications.