blob: 35c870477c1a7d6543881b4a323143dfb0575ad1 (
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
34
35
36
37
|
using ArcaneLibs.Extensions;
using LibMatrix.Services;
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.AddRoryLibMatrixServices();
services.AddSingleton<Config>(config => {
var conf = new Config();
configuration?.GetSection("Configuration").Bind(conf);
File.WriteAllText("configuration.json", conf.ToJson());
return conf;
});
}
protected override ValueTask DisposeAsyncCore()
=> new();
protected override IEnumerable<TestAppSettings> GetTestAppSettings() {
yield return new TestAppSettings { Filename = "appsettings.json", IsOptional = true };
}
}
|