Files
SteamTools/System.Common.UnitTest/SetupFixture.cs
T
2021-02-20 16:45:44 +08:00

35 lines
897 B
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NUnit.Framework;
using System.Logging;
namespace System
{
[SetUpFixture]
public class SetupFixture
{
[OneTimeSetUp]
public void OneTimeSetUp()
{
// TODO: Add code here that is run before
// all tests in the assembly are run
if (!DI.IsInit)
{
DI.Init(ConfigureServices);
}
}
[OneTimeTearDown]
public void OneTimeTearDown()
{
// TODO: Add code here that is run after
// all tests in the assembly have been run
}
static void ConfigureServices(IServiceCollection services)
{
services.AddLogging(l => l.AddProvider(NUnitLoggerProvider.Instance));
//services.AddPinyin();
}
}
}