Some checks failed
CodeQL / Analyze (csharp) (push) Has been cancelled
Close Stale Issues / close_stale_issues (push) Has been cancelled
repo-sync / repo-sync (push) Has been cancelled
auto-deploy-tencent-scf / pre-check (push) Has been cancelled
auto-deploy-tencent-scf / deploy serverless (push) Has been cancelled
36 lines
898 B
C#
36 lines
898 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Text.Json;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Microsoft.Extensions.Hosting;
|
|
using Microsoft.Extensions.Options;
|
|
using Ray.BiliBiliTool.Config;
|
|
using Ray.BiliBiliTool.Config.Options;
|
|
using Ray.BiliBiliTool.Console;
|
|
using Ray.BiliBiliTool.Infrastructure;
|
|
using Xunit;
|
|
|
|
namespace ConfigTest
|
|
{
|
|
public class TestDefaultValue
|
|
{
|
|
public TestDefaultValue()
|
|
{
|
|
Program.CreateHost(null);
|
|
}
|
|
|
|
[Fact]
|
|
public void Test1()
|
|
{
|
|
using var scope = Global.ServiceProviderRoot.CreateScope();
|
|
|
|
var options = scope.ServiceProvider.GetRequiredService<
|
|
IOptionsMonitor<DailyTaskOptions>
|
|
>();
|
|
var re = options.CurrentValue.NumberOfCoins;
|
|
Debug.WriteLine(re);
|
|
}
|
|
}
|
|
}
|