Table of Contents

Class NavigationHistory

Namespace
Bunit.TestDoubles
Assembly
Bunit.Web.dll

Represents a navigation to a Uri with a set of specific navigation Options.

public sealed class NavigationHistory : IEquatable<NavigationHistory>
Inheritance
NavigationHistory
Implements
Inherited Members
Extension Methods

Constructors

NavigationHistory(string, NavigationOptions)

Initializes a new instance of the NavigationHistory class.

public NavigationHistory(string uri, NavigationOptions options)

Parameters

uri string
options NavigationOptions

NavigationHistory(string, NavigationOptions)

Initializes a new instance of the NavigationHistory class.

public NavigationHistory(string uri, NavigationOptions options)

Parameters

uri string
options NavigationOptions

NavigationHistory(string, NavigationOptions, NavigationState, Exception?)

Initializes a new instance of the NavigationHistory class.

public NavigationHistory(string uri, NavigationOptions options, NavigationState navigationState, Exception? exception = null)

Parameters

uri string
options NavigationOptions
navigationState NavigationState
exception Exception

Properties

Exception

Gets the exception thrown from the OnBeforeInternalNavigation handler, if any.

public Exception? Exception { get; }

Property Value

Exception

Remarks

Will not be null when State is Faulted.

Options

Gets the options that was specified when the was navigated to.

public NavigationOptions Options { get; }

Property Value

NavigationOptions

State

Gets the NavigationState associated with this history entry.

public NavigationState State { get; }

Property Value

NavigationState

Uri

Gets the Uri that was navigated to.

public string Uri { get; }

Property Value

string

Methods

Equals(NavigationHistory?)

public bool Equals(NavigationHistory? other)

Parameters

other NavigationHistory

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

StateFromJson<T>(JsonSerializerOptions?)

Deserialize the content of Options.HistoryEntryState into T if it is not null.

public T? StateFromJson<T>(JsonSerializerOptions? options = null)

Parameters

options JsonSerializerOptions

The JsonSerializerOptions used when deserializing. If not provided, Default is used.

Returns

T

The target type of the JSON value.

Type Parameters

T

The type to deserialize the content of Options.HistoryEntryState to.

Exceptions

InvalidOperationException

When Options.HistoryEntryState is null.

.NET Foundation

Supported by the .NET Foundation.