Class BunitNavigationManager
- Namespace
- Bunit.TestDoubles
- Assembly
- bunit.dll
Represents a NavigationManager that captures calls to NavigateTo(string, bool) for testing purposes.
public sealed class BunitNavigationManager : NavigationManager
- Inheritance
-
BunitNavigationManager
- Inherited Members
- Extension Methods
Constructors
BunitNavigationManager(BunitContext)
Initializes a new instance of the BunitNavigationManager class.
public BunitNavigationManager(BunitContext bunitContext)
Parameters
bunitContextBunitContext
Properties
History
The navigation history captured by the BunitNavigationManager. This is a stack based collection, so the first element is the latest/current navigation target.
public IReadOnlyCollection<NavigationHistory> History { get; }
Property Value
Remarks
The initial Uri is not added to the history.
Methods
HandleLocationChangingHandlerException(Exception, LocationChangingContext)
Handles exceptions thrown in location changing handlers.
protected override void HandleLocationChangingHandlerException(Exception ex, LocationChangingContext context)
Parameters
exExceptionThe exception to handle.
contextLocationChangingContextThe context passed to the handler.
NavigateToCore(string, NavigationOptions)
Navigates to the specified URI.
protected override void NavigateToCore(string uri, NavigationOptions options)
Parameters
uristringThe destination URI. This can be absolute, or relative to the base URI (as returned by BaseUri).
optionsNavigationOptionsProvides additional NavigationOptions.
SetNavigationLockState(bool)
Sets whether navigation is currently locked. If it is, then implementations should not update Uri and call NotifyLocationChanged(bool) until they have first confirmed the navigation by calling NotifyLocationChangingAsync(string, string, bool).
protected override void SetNavigationLockState(bool value)
Parameters
valueboolWhether navigation is currently locked.