mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
feat(config): 添加YAML配置序列化支持并完善测试依赖
- 集成YamlDotNet库实现YAML配置文件的序列化功能 - 在配置消费者集成测试中添加抽象配置接口引用 - 在YAML配置验证测试中添加抽象配置接口引用 - 统一配置模块的依赖注入和接口抽象层次
This commit is contained in:
parent
1fac276437
commit
925b6ce2d2
@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using GFramework.Game.Abstractions.Config;
|
||||
using GFramework.Game.Config;
|
||||
using GFramework.Game.Config.Generated;
|
||||
|
||||
@ -11,8 +12,6 @@ namespace GFramework.Game.Tests.Config;
|
||||
[TestFixture]
|
||||
public class GeneratedConfigConsumerIntegrationTests
|
||||
{
|
||||
private string _rootPath = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 为每个端到端测试准备独立的配置根目录,避免编译期 schema 资产与运行时写入互相污染。
|
||||
/// </summary>
|
||||
@ -35,6 +34,8 @@ public class GeneratedConfigConsumerIntegrationTests
|
||||
}
|
||||
}
|
||||
|
||||
private string _rootPath = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 验证生成器自动拾取消费者项目的 schema 后,
|
||||
/// 可以用生成的聚合注册辅助完成加载,并通过强类型表包装访问运行时数据与查询辅助。
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.IO;
|
||||
using GFramework.Game.Abstractions.Config;
|
||||
using GFramework.Game.Config;
|
||||
|
||||
namespace GFramework.Game.Tests.Config;
|
||||
@ -9,8 +10,6 @@ namespace GFramework.Game.Tests.Config;
|
||||
[TestFixture]
|
||||
public sealed class YamlConfigTextValidatorTests
|
||||
{
|
||||
private string _rootPath = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 为每个测试准备独立临时目录。
|
||||
/// </summary>
|
||||
@ -33,6 +32,8 @@ public sealed class YamlConfigTextValidatorTests
|
||||
}
|
||||
}
|
||||
|
||||
private string _rootPath = null!;
|
||||
|
||||
/// <summary>
|
||||
/// 验证合法 YAML 文本会通过公开校验入口。
|
||||
/// </summary>
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
using YamlDotNet.Serialization;
|
||||
using YamlDotNet.Serialization.NamingConventions;
|
||||
|
||||
namespace GFramework.Game.Config;
|
||||
|
||||
/// <summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user