mirror of
https://github.com/DrMboga/WotBlitzStatisticsBlazor.git
synced 2026-10-24 11:50:05 +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,39 @@
|
||||
using Bunit;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Radzen;
|
||||
using WotBlitzStatisticsPro.Blazor.Services;
|
||||
|
||||
namespace WotBlitzStatisticsPro.Blazor.Tests
|
||||
{
|
||||
public class TestContextBase: TestContextWrapper
|
||||
{
|
||||
protected Mock<IMediator> MediatorMock;
|
||||
protected Mock<ISearchDialogService> SearchServiceMock;
|
||||
protected MockNavigationManager NavigationManagerMock;
|
||||
|
||||
[SetUp]
|
||||
protected void Init()
|
||||
{
|
||||
MediatorMock = new();
|
||||
SearchServiceMock = new();
|
||||
NavigationManagerMock = new();
|
||||
|
||||
TestContext = new Bunit.TestContext();
|
||||
TestContext.Services.AddSingleton(MediatorMock.Object);
|
||||
TestContext.Services.AddLocalization();
|
||||
|
||||
TestContext.Services.AddSingleton<DialogService>();
|
||||
TestContext.Services.AddSingleton(SearchServiceMock.Object);
|
||||
|
||||
|
||||
TestContext.Services.AddSingleton<NavigationManager>(NavigationManagerMock);
|
||||
}
|
||||
|
||||
[TearDown]
|
||||
public void TearDown() => TestContext?.Dispose();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user