2020-08-05 17:06:14 +08:00
|
|
|
|
using System;
|
2020-09-07 22:46:50 +08:00
|
|
|
|
using System.Globalization;
|
2020-08-05 17:06:14 +08:00
|
|
|
|
using Bunit;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
2020-09-05 20:27:52 +08:00
|
|
|
|
using Newtonsoft.Json;
|
2020-08-05 17:06:14 +08:00
|
|
|
|
|
|
|
|
|
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();
|
2021-03-09 21:54:30 +08:00
|
|
|
|
|
|
|
|
|
//Needed for Tests using Overlay
|
|
|
|
|
Context.Services.AddScoped<AntDesign.JsInterop.DomEventService>(sp => new TestDomEventService(Context.JSInterop.JSRuntime));
|
2020-09-07 22:46:50 +08:00
|
|
|
|
|
2020-09-16 13:58:16 +08:00
|
|
|
|
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
|
2020-08-05 17:06:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
Context?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|