RunicNavigationPathTesting class

Namespace Runic.Application.Testing in Runic.Application.Testing 0.23.0

public static class RunicNavigationPathTesting

Saves and restores navigation paths in tests, as an application does across a restart.

Methods

RestorePathAsync

public static Task<RunicNavigationRestore> RestorePathAsync(this RunicNavigator navigator, string saved, NavigationRestoreOptions? options = null, CancellationToken cancellationToken = default)

Restores saved, a path RunicNavigationPathTesting.SavePath returned, into navigator, and reads the path back: RunicNavigationRestore.IsExact tells whether the restored navigation is the saved one.

Parameters

navigator

The navigator of the window after the restart.

saved

The saved JSON.

options

The restore's options, such as its route map; the defaults without them.

cancellationToken

Cancels the restore.

SavePath

public static string SavePath(this RunicNavigator navigator, INavigationRouteMap? routes = null)

Saves navigator's path through its JSON form, as an application's store would keep it, so the restore in a new window scope reads what a restart reads.

Parameters

navigator

The navigator of the window before the restart.

routes

The route map, or null for the navigator's registered one.