基于示例生成测试用例
author-test
根据给定示例生成测试。参数:<cs_root> C# SDK 仓库根目录;<package_name> 包名:Azure.AI.Projects、Azure.AI.Projects.Agents 或 Azure.AI.Extensions.OpenAI 之一;<sample_name> 用作测试起点的示例。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6.1k
- Forks
- 5.2k
01 前言 Front Matter
- name
- author-test
- description
- Generate a test given sample. Parameters: <cs_root> C# SDK repository root; <package_name> Package name: one of Azure.AI.Projects, Azure.AI.Projects.Agents or Azure.AI.Extensions.OpenAI; <sample_name> the sample to use as a starting point for the test.
02 资源文件 44
- 参考文档bmad-skill-manifest.yaml12 B
- 参考文档checklist.md3.7 KB
- 资产文件game-types.csv2.9 KB
- 参考文档game-types/action-platformer.md786 B
- 参考文档game-types/adventure.md2.0 KB
- 参考文档game-types/card-game.md1.5 KB
- 参考文档game-types/fighting.md1.6 KB
- 参考文档game-types/horror.md1.9 KB
- 参考文档game-types/idle-incremental.md1.4 KB
- 参考文档game-types/metroidvania.md1.8 KB
- 参考文档game-types/moba.md1.5 KB
- 参考文档game-types/party-game.md1.6 KB
- 参考文档game-types/puzzle.md924 B
- 参考文档game-types/racing.md1.7 KB
- 参考文档game-types/rhythm.md1.5 KB
- 参考文档game-types/roguelike.md1.1 KB
- 参考文档game-types/rpg.md1.1 KB
- 参考文档game-types/sandbox.md1.6 KB
- 参考文档game-types/shooter.md1.6 KB
- 参考文档game-types/simulation.md1.5 KB
- 参考文档game-types/sports.md1.4 KB
- 参考文档game-types/strategy.md1.8 KB
- 参考文档game-types/survival.md1.5 KB
- 参考文档game-types/text-based.md1.9 KB
- 参考文档game-types/tower-defense.md1.6 KB
- 参考文档game-types/turn-based-tactics.md1.9 KB
- 参考文档game-types/visual-novel.md2.0 KB
- 参考文档steps/step-01-init.md9.0 KB
- 参考文档steps/step-01b-continue.md5.9 KB
- 参考文档steps/step-02-context.md11.0 KB
- 参考文档steps/step-03-platforms.md7.6 KB
- 参考文档steps/step-04-vision.md7.0 KB
- 参考文档steps/step-05-core-gameplay.md8.3 KB
- 参考文档steps/step-06-mechanics.md7.8 KB
- 参考文档steps/step-07-game-type.md7.7 KB
- 参考文档steps/step-08-progression.md8.2 KB
- 参考文档steps/step-09-levels.md8.3 KB
- 参考文档steps/step-10-art-audio.md7.8 KB
- 参考文档steps/step-11-technical.md7.8 KB
- 参考文档steps/step-12-epics.md7.6 KB
- 参考文档steps/step-13-metrics.md7.6 KB
- 参考文档steps/step-14-complete.md9.6 KB
- 参考文档templates/gdd-template.md1.5 KB
- 参考文档workflow.md3.0 KB
03 SKILL.md 正文
Basic information.
This skill requires C# repository root (<cs_root>), package name (<package_name>), and sample file name as an input (<sample_name>). The samples are located in the <cs_root>/sdk/ai/<package_name>/tests/Samples directory, the test files are in <cs_root>/sdk/ai/<package_name>/tests. The tests are organized according to scenarios tested. The files, having suffix Base contains the required utility functions needed for testing.
Task
Look at the sample and generate the test code in the appropriate test file. The test must have the next structure:
[RecordedTest]
// Test cases if any [TestCase(true)]
public async Task TestFeatureName(){
var result = await CallFeatureAsync();
Assert.That(result.Value, Is.Equal.To("Expected feature value"))
}
Always use the async methods (with Async suffix) if possible. Keep the test short and representative. To make sure that the test is running as expected, build the project.
cd <cs_root>
dotnet build
cd <cs_root>
dotnet build
If the project does not build, iterate on the error.
04 同仓库更多 Skills
WebPubSub Chat API 基线维护
update-chat-api
使用场景:在公共 API 发生变更后,更新、导出、刷新或验证 Azure.Messaging.WebPubSub.Chat 的公共 API 基线。
Azure 搜索文档 SDK 端到端工作流
search-documents
Azure.Search.Documents SDK 的端到端(E2E)工作流技能(TypeSpec + 大量定制)。处理完整发布周期和部分更新:SHA 更新;代码生成;构建;定制修复;ServiceVersion 同步;测试;API 导出;变更日志;版本;示例;格式化;发布元数据。使用场景:为 Azure.Search.Documents 创建新包版本;重新生成 Azure.Search.Documents;修复 Azure.Search.Documents 错误;发布 Azure.Search.Documents;更新 Azure.Search.Documents 规范。不适用于 Azure.ResourceManager.Search 或 Azure.Provisioning.Search。
Search.Documents 版本差异检测
search-documents-version-diff
将当前 Azure.Search.Documents 公共 API 接口与之前发布的版本进行对比,检测因 TypeSpec 变更后 SDK 自定义层未向上传播而导致的预览版之间的回归。当用户要求比较 Azure.Search.Documents 各 beta 版本、确认 Azure.Search.Documents 预览功能未丢失、审计 Azure.Search.Documents 各版本间的回归、对 Azure.Search.Documents 发布分支进行健全性检查,或排查 Azure.Search.Documents 预览功能缺失时使用——即使用户没有提到“diff”一词。专门捕获丢失的包装器(QueryAnswer/QueryCaption/QueryRewrites 类型)、丢失的 SearchOptions 聚合重定向器、`@@access("internal")` 翻转、被直接删除而非通过条件门控的 `#if AZURE_SEARCH_PREVIEW` 代码块、丢失的 `ServiceVersion` 枚举值,以及便捷方法降级为协议方法等问题。
Search.Documents TypeSpec 一致性验证
search-documents-typespec-validation
面向 Azure.Search.Documents SDK 的 TypeSpec 验证技能。针对任意固定 commit 的 TypeSpec 定义,对全部操作、全部模型、全部枚举和全部属性执行完整验证。适用于任何 API 版本。生成完整的差距报告:缺失功能、多余功能、命名不匹配以及建议的修复位置。适用场景:“根据 TypeSpec 验证 Azure.Search.Documents SDK”、“检测 Azure.Search.Documents TypeSpec 功能差距”、“Azure.Search.Documents SDK 缺少哪些功能”、“将 Azure.Search.Documents SDK 与规范对比”、“对 Azure.Search.Documents 进行完整的规范覆盖审计”。请勿用于版本间差异对比或回归检测——此类情况请使用 search-documents-version-diff。
掷骰子技能文件测试
test-skill_file
使用随机数生成器掷骰子。
随机数掷骰子
roll-dice
使用随机数生成器掷骰子。当用户要求掷单个骰子(d6、d20 等)、掷骰子或生成随机掷骰结果时使用。