Class FakeNavigationManager
Backward-compatible wrapper around Bunit.TestDoubles.BunitNavigationManager.
Inherited Members
Namespace: Bunit.TestDoubles
Assembly: FastMoq.Web.dll
Syntax
public sealed class FakeNavigationManager
Remarks
This wrapper keeps older FastMoq navigation assertions stable while delegating to bUnit 2's navigation manager.
Constructors
FakeNavigationManager(BunitNavigationManager)
Initializes a new instance of the FakeNavigationManager class.
Declaration
public FakeNavigationManager(BunitNavigationManager inner)
Parameters
| Type | Name | Description |
|---|---|---|
| BunitNavigationManager | inner | The underlying bUnit navigation manager. |
Properties
BaseUri
Gets the base URI.
Declaration
public string BaseUri { get; }
Property Value
| Type | Description |
|---|---|
| string |
History
Gets the captured navigation history.
Declaration
public IReadOnlyCollection<NavigationHistory> History { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<NavigationHistory> |
Examples
ClickButton("#review-orders", () => NavigationManager.History.Count == 1);
NavigationManager.Uri.Should().Contain("/orders/review");
InnerManager
Gets the underlying bUnit navigation manager.
Declaration
public BunitNavigationManager InnerManager { get; }
Property Value
| Type | Description |
|---|---|
| BunitNavigationManager |
Uri
Gets the current URI.
Declaration
public string Uri { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
NavigateTo(string, NavigationOptions)
Navigates to the specified URI using navigation options.
Declaration
public void NavigateTo(string uri, NavigationOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uri | The destination URI. |
| NavigationOptions | options | The navigation options. |
NavigateTo(string, bool, bool)
Navigates to the specified URI.
Declaration
public void NavigateTo(string uri, bool forceLoad = false, bool replace = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uri | The destination URI. |
| bool | forceLoad | Whether to force a full page load. |
| bool | replace | Whether to replace the current history entry. |
ToAbsoluteUri(string)
Converts a URI to an absolute URI.
Declaration
public Uri ToAbsoluteUri(string relativeUri)
Parameters
| Type | Name | Description |
|---|---|---|
| string | relativeUri | The relative URI. |
Returns
| Type | Description |
|---|---|
| Uri | The absolute URI. |
ToBaseRelativePath(string)
Converts a URI to a base-relative path.
Declaration
public string ToBaseRelativePath(string uri)
Parameters
| Type | Name | Description |
|---|---|---|
| string | uri | The URI to convert. |
Returns
| Type | Description |
|---|---|
| string | The base-relative path. |