Table of Contents

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

bunitContext BunitContext

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

IReadOnlyCollection<NavigationHistory>

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

ex Exception

The exception to handle.

context LocationChangingContext

The context passed to the handler.

NavigateToCore(string, NavigationOptions)

Navigates to the specified URI.

protected override void NavigateToCore(string uri, NavigationOptions options)

Parameters

uri string

The destination URI. This can be absolute, or relative to the base URI (as returned by BaseUri).

options NavigationOptions

Provides 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

value bool

Whether navigation is currently locked.

.NET Foundation

Supported by the .NET Foundation.