mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +08:00
f20d863bc3
* Add TestDomEventService to TestBase * chore(tests): update to net5 * feat(testdomeventservice): override eventdomservice to null * fix(AddEventListener): make AddEventListener virtual * feat(test): add basic overlay test * fix(name): make name .cs
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using Bunit;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace AntDesign.Tests
|
|
{
|
|
public class AntDesignTestBase : IDisposable
|
|
{
|
|
public TestContext Context { get; }
|
|
public TestNavigationManager NavigationManager { get; }
|
|
|
|
public AntDesignTestBase()
|
|
{
|
|
Context = new TestContext();
|
|
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();
|
|
}
|
|
}
|
|
}
|