2024-01-26 16:48:47 +03:00
|
|
|
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();
|
2024-02-09 16:48:42 +03:00
|
|
|
collection.AddProductParsers();
|
2024-01-26 16:48:47 +03:00
|
|
|
ServiceProvider = collection.BuildServiceProvider();
|
|
|
|
}
|
|
|
|
|
|
|
|
[OneTimeTearDown]
|
|
|
|
public void DisposeProvider()
|
|
|
|
{
|
|
|
|
ServiceProvider?.Dispose();
|
|
|
|
}
|
|
|
|
}
|