ant-design-blazor/tests/AntDesignTestBase.cs

32 lines
824 B
C#
Raw Normal View History

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