feat: Reinitialize the Repository.

重新初始化仓库。
This commit is contained in:
Zony
2021-05-07 10:26:26 +08:00
parent a754f419b2
commit 8e1e61764c
78 changed files with 3329 additions and 22 deletions

View File

@@ -0,0 +1,33 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using ZonyLrcTools.Cli.Commands;
using ZonyLrcTools.Cli.Infrastructure.DependencyInject;
using ZonyLrcTools.Cli.Infrastructure.Extensions;
namespace ZonyLrcTools.Tests
{
public class TestBase
{
protected IServiceProvider ServiceProvider { get; private set; }
protected IServiceCollection ServiceCollection { get; private set; }
public TestBase()
{
ServiceCollection = BuildService();
BuildServiceProvider();
}
protected virtual IServiceCollection BuildService()
{
var service = new ServiceCollection();
service.BeginAutoDependencyInject<ToolCommand>();
service.ConfigureToolService();
service.ConfigureConfiguration();
return service;
}
protected virtual void BuildServiceProvider() => ServiceProvider = ServiceCollection.BuildServiceProvider();
}
}