Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Test HTTP command error responses through real endpoints

未关闭
#605 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 7 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
58/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
csharp
领域
api, testing

调研方向

Start with ResultExtensions.cs and the existing ASP.NET Core test application; trace the separate minimal-API and controller command mappings. Add hosted HTTP tests for each listed command outcome, then run the affected endpoint tests and collect focused coverage. Done means both mappings assert status, response body, and problem-details content type without checking full stack traces.

由索引模型根据 Issue 内容生成。

描述

Problem

The HTTP result-mapping code has approximately 24% line coverage in the October 5, 2026 .NET 10 coverage run. Most error-response paths are untested. These paths define the status codes and problem-details bodies that API clients rely on. You can view a test coverage report I generated here: index.html

Source: ResultExtensions.cs.

Proposed tests

Send HTTP requests to test endpoints backed by command services that produce each outcome:

Command outcome Expected response
Success HTTP 200 with the expected result body
Domain validation failure HTTP 400 with domain validation details
Missing aggregate HTTP 404 with problem details
Optimistic concurrency conflict HTTP 409 with problem details
Unexpected failure HTTP 500 with problem details

Cover both minimal-API and controller command mappings, since they use separate result-conversion paths. Assert the response content type and stable problem-details fields, including domain errors where applicable.

Acceptance criteria

  • Each outcome is exercised through an HTTP request to a hosted test application.
  • Both minimal-API and controller mappings are covered.
  • Assertions verify status codes and response bodies, rather than only whether requests complete.
  • Error responses use the expected problem-details content type and structure.
  • Tests avoid brittle comparisons of full exception stack traces.
  • No direct tests of ResultExtensions, external database, or Docker container are required.

Validation

Extend the existing ASP.NET Core test application and run the affected endpoint tests. Collect focused coverage for the HTTP result-mapping paths; do not rerun unrelated provider suites.

主要语言
C#
星标
512
派生
99
平均合并
5 天 6 小时
30 天内合并 PR
5

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Eventuous/eventuous 的其他 Issue

查看 Eventuous/eventuous 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。