mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-23 19:30:06 +02:00
feat: Blazor tests added
This commit is contained in:
1 parent
b4378b643b
commit
c60f622989
7 files changed
+309
-21
No files matched your search
@@ -0,0 +1,30 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Tests
|
||||
{
|
||||
public class MockNavigationManager: NavigationManager
|
||||
{
|
||||
public int NavigationCount { get; private set; } = 0;
|
||||
|
||||
public MockNavigationManager()
|
||||
{
|
||||
Initialize("https://unit-test.example/", "https://unit-test.example/bla-bla");
|
||||
}
|
||||
|
||||
|
||||
protected override void NavigateToCore(string uri, bool forceLoad)
|
||||
{
|
||||
if (uri == "/")
|
||||
{
|
||||
Uri = BaseUri;
|
||||
}
|
||||
else if (uri.StartsWith("/") && uri.Length > 1)
|
||||
{
|
||||
Uri = $"{BaseUri}{uri.Substring(1)}";
|
||||
}
|
||||
NotifyLocationChanged(false);
|
||||
|
||||
NavigationCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user