public static class RunicTestNavigationEntry Creates navigation entries for unit tests of content that takes a NavigationEntryContext.
Methods
CreateAsync
public static Task<RunicTestNavigationEntry<TContent>> CreateAsync<TContent>(Func<NavigationEntryContext, TContent> create, IServiceProvider? services = null, CancellationToken cancellationToken = default) where TContent : class Creates a navigator with its own RunicModelContext and one region, and pushes the content that create constructs with its entry's NavigationEntryContext, as the navigator constructs a page: the content is owned by its entry, and its navigation hooks run as in the application.
Type parameters
TContentThe content's type.
Parameters
createConstructs the content with its entry's context.
servicesThe navigator's services (
RunicNavigatorOptions.Services), whichNavigationEntryContext.Servicesreturns, ornullfor none.cancellationTokenCancels the push.
Returns
The entry, current in its region.
Exceptions
InvalidOperationExceptionThe push did not commit, for example because
createthrew.
Remarks
The entry is pushed with NavigationRegion.PushForResult for an Object result, so NavigationEntryContext.CompleteAsync accepts a value of any type and RunicTestNavigationEntry.Completion reports it.