mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
68966ef511
Co-authored-by: James Yeung <shunjiey@hotmail.com>
34 lines
969 B
C#
34 lines
969 B
C#
using System;
|
|
using System.Globalization;
|
|
using Bunit;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace AntDesign.Tests
|
|
{
|
|
public class AntDesignTestBase : TestContext, IDisposable
|
|
{
|
|
public TestNavigationManager NavigationManager { get; }
|
|
|
|
protected TestContext Context => this;
|
|
|
|
public AntDesignTestBase()
|
|
{
|
|
NavigationManager = new TestNavigationManager();
|
|
|
|
Context.Services.AddScoped<NavigationManager>(sp => NavigationManager);
|
|
Context.Services.AddAntDesign();
|
|
|
|
//Needed for Tests using Overlay
|
|
Context.Services.AddScoped<AntDesign.JsInterop.DomEventService>(sp => new TestDomEventService(Context.JSInterop.JSRuntime));
|
|
|
|
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
Context?.Dispose();
|
|
}
|
|
}
|
|
}
|