csharp/christiansparre/BlazorAuthenticationSample/tests/BlazorAuthenticationSample.Client.Tests/TestNavigationManager.cs

TestNavigationManager.cs
using Microsoft.AspNetCore.Components;
using System.Collections.Generic;

namespace BlazorAuthenticationSample.Client.Tests
{
    public clast TestNavigationManager : NavigationManager
    {
        public Stack Navigations { get; set; } = new Stack();

        public void SetInitialized(string baseUri = "https://example.com/", string uri = "test/test") => Initialize(baseUri, baseUri + uri);

        protected override void NavigateToCore(string uri, bool forceLoad)
        {
            Navigations.Push((uri, forceLoad));
        }
    }
}