You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
968 B
31 lines
968 B
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Volo.Abp;
|
|
|
|
namespace Win.Abp.NumberConverter.Test
|
|
{
|
|
public class NumberConverterTestsHostedService : IHostedService
|
|
{
|
|
|
|
|
|
public async Task StartAsync(CancellationToken cancellationToken)
|
|
{
|
|
using (var application = AbpApplicationFactory.Create<NumberConverterTestsModule>(options =>
|
|
{
|
|
options.Services.AddLogging(_ => { });
|
|
}))
|
|
{
|
|
application.Initialize();
|
|
var sp = application.ServiceProvider;
|
|
var testService = sp.GetService<NumberConverterTestService>();
|
|
await testService.RunAsync();
|
|
|
|
application.Shutdown();
|
|
}
|
|
}
|
|
|
|
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
|
}
|
|
}
|