0
0
RhSolutions-Api/RhSolutions.Api.Tests/TestServiceCollection.cs
Serghei Cebotari 118761ebc2
All checks were successful
Test API / test (push) Successful in 2m17s
Use Service Provider for test purposes
2024-01-26 16:48:47 +03:00

23 lines
476 B
C#

using Microsoft.Extensions.DependencyInjection;
namespace RhSolutions.Api.Tests;
[SetUpFixture]
public class TestServiceCollection
{
public static ServiceProvider? ServiceProvider { get; private set; }
[OneTimeSetUp]
public void CreateProvider()
{
var collection = new ServiceCollection();
collection.AddModifiers();
ServiceProvider = collection.BuildServiceProvider();
}
[OneTimeTearDown]
public void DisposeProvider()
{
ServiceProvider?.Dispose();
}
}