pull file
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
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
This commit is contained in:
35
test/ConfigTest/TestDefaultValue.cs
Normal file
35
test/ConfigTest/TestDefaultValue.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user