一键导入
dotnet-testing
Testing patterns and conventions for the AvnDataGenie .NET solution
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Testing patterns and conventions for the AvnDataGenie .NET solution
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | dotnet-testing |
| description | Testing patterns and conventions for the AvnDataGenie .NET solution |
| domain | testing |
| confidence | high |
| source | huntress |
The AvnDataGenie solution uses xUnit on .NET 10. The test project is src/AvnDataGenie.Tests/. Tests run with dotnet test src/AvnDataGenie.Tests/AvnDataGenie.Tests.csproj.
AvnDataGenie.csproj has <InternalsVisibleTo Include="AvnDataGenie.Tests" />. Use internal visibility (not public) for methods that need testing but shouldn't be part of the public API.
One test class per production class or logical unit:
SqlPromptBuilderTests.cs — tests for SqlPromptBuilder.CreateSystemPromptFromJson()CleanAndFormatSqlTests.cs — tests for Generator.CleanAndFormatSql()FormatSqlTests.cs — tests for Generator.FormatSql() and Generator.FormatSelectColumns()Use private static methods to generate test JSON inputs (e.g., MinimalSchemaJson(), RichConfigJson()). Keep test data as close to real shapes as possible — the JSON must match the deserialization models in SqlPromptBuilder.
Prioritize testing pure/static methods that have no external dependencies. In this codebase:
SqlPromptBuilder.CreateSystemPromptFromJson() — public static, takes JSON stringsGenerator.CleanAndFormatSql() — internal static, sanitizes LLM outputGenerator.FormatSql() — internal static, formats SQLGenerator.FormatSelectColumns() — internal static, formats SELECT columnsSchemaGenerator.Generator.GenerateDatabaseSchemaAsync() requires a live SQL Server connection. Unit tests cannot cover this without a database fixture.
Assert.Contains for structural assertions since the formatting regexes produce complex output.