mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-08 01:24:31 +08:00
docs(tests): 为配置加载器测试添加方法文档注释
- 为 BuildMonsterConfigYaml 方法添加 XML 文档注释 - 为 BuildMonsterSchema 方法添加 XML 文档注释 - 为 IndentLines 方法添加 XML 文档注释 - 补充参数和返回值说明信息
This commit is contained in:
parent
cfd4ae97d3
commit
3aca959fcb
@ -541,6 +541,11 @@ public sealed class YamlConfigLoaderAllOfTests
|
||||
CreateConfigFile(relativePath, content);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建带有指定奖励内容的怪物配置 YAML 文本。
|
||||
/// </summary>
|
||||
/// <param name="rewardYaml">奖励对象的 YAML 片段。</param>
|
||||
/// <returns>完整的怪物配置 YAML 文本。</returns>
|
||||
private static string BuildMonsterConfigYaml(string rewardYaml)
|
||||
{
|
||||
return $$"""
|
||||
@ -550,6 +555,12 @@ public sealed class YamlConfigLoaderAllOfTests
|
||||
""";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 构建带有指定奖励属性和 allOf 约束的怪物 schema JSON。
|
||||
/// </summary>
|
||||
/// <param name="rewardPropertiesJson">奖励对象的 properties JSON 片段。</param>
|
||||
/// <param name="allOfJson">allOf 约束的 JSON 数组片段。</param>
|
||||
/// <returns>完整的 schema JSON 文本。</returns>
|
||||
private static string BuildMonsterSchema(
|
||||
string rewardPropertiesJson,
|
||||
string allOfJson)
|
||||
@ -570,6 +581,12 @@ public sealed class YamlConfigLoaderAllOfTests
|
||||
""";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 为多行文本的每一行添加指定数量的空格缩进。
|
||||
/// </summary>
|
||||
/// <param name="text">原始文本。</param>
|
||||
/// <param name="indentLevel">缩进空格数。</param>
|
||||
/// <returns>添加缩进后的文本。</returns>
|
||||
private static string IndentLines(string text, int indentLevel)
|
||||
{
|
||||
var indentation = new string(' ', indentLevel);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user