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();
|
2020-09-07 22:46:50 +08:00
|
|
|
|
|
2020-09-08 16:43:44 +08:00
|
|
|
|
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CurrentCulture;
|
2020-08-05 17:06:14 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
Context?.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|