about summary refs log tree commit diff
path: root/Tests/LibMatrix.Tests/Fixtures/TestFixture.cs
blob: 01a0d2fcd57dcd8462a7f50e98b0124b5eb180f8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using ArcaneLibs.Extensions;
using LibMatrix.Services;
using LibMatrix.Tests.Abstractions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Xunit.Microsoft.DependencyInjection;
using Xunit.Microsoft.DependencyInjection.Abstracts;

namespace LibMatrix.Tests.Fixtures;

public class TestFixture : TestBedFixture {
    protected override void AddServices(IServiceCollection services, IConfiguration configuration) {
        // services.AddSingleton<TieredStorageService>(x =>
        //     new TieredStorageService(
        //         null,
        //         null
        //     )
        // );
        services.AddSingleton(configuration);

        services.AddRoryLibMatrixServices();
        services.AddLogging();
        services.AddSingleton<HomeserverAbstraction>();
        services.AddSingleton<Config>();
    }

    protected override ValueTask DisposeAsyncCore()
        => new();

    protected override IEnumerable<TestAppSettings> GetTestAppSettings() {
        yield return new TestAppSettings { Filename = "appsettings.json", IsOptional = true };
    }
}