• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AKlaus / DomainResult / 44690077893
87%

Build:
DEFAULT BRANCH: master
Ran 20 Nov 2026 06:46AM UTC
Jobs 1
Files 22
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Nov 2026 06:45AM UTC coverage: 87.184% (+2.6%) from 84.615%
44690077893

push

github

web-flow
Mvc: Build ProblemDetails with ProblemDetailsFactory (#107)

### Why

The same status gave a different `ProblemDetails` body in the two conversions. The `IActionResult` conversion built a plain `ObjectResult`, so its body had no `type`. The `IResult` conversion calls `TypedResults.Problem()`, which sets `type`.

### What changed

- **Mvc** — an `ObjectResult` subclass completes the body with `ProblemDetailsFactory` when it runs
- **Tests** — the 4xx tests run each `IActionResult` and compare its body with the `IResult` conversion
- **Tests** — failure rows for `ToActionResultOfT()`, which had none before
- **README** — a note on `type`, `traceId` and the `AddProblemDetails()` customisation

This is option 2 of #95. The result is still an `ObjectResult`, so a consumer test that casts to it keeps working. An exact type check fails, as **Behaviour** says. The factory gets the fields that the `errorAction` set, so it keeps them. If the factory or the customisation sets an extension too, such as `traceId`, its value wins. The `IResult` conversion does the same only from .NET 9 with `AddProblemDetails()`. On earlier targets, or without `AddProblemDetails()`, it keeps a `traceId` that the `errorAction` sets.

The bodies cannot match in every case. The controller body always has `traceId`, as `ControllerBase.Problem()` does. The `IResult` body has it only from .NET 9 with `AddProblemDetails()`.

### Changes at a glance

No tangible change that `scope` detects.

**Areas**: `src`, `tests`

**Behaviour** (not seen by `scope`)

- The `IActionResult` error body now has `type`, `traceId`, and the `AddProblemDetails()` customisation. HTTP codes, titles and signatures do not change.
- `ObjectResult.Value` gets `type` and `traceId` only when the result runs. A test that reads `Value` without running the result sees no `type`.
- An `errorAction` extension whose key the factory or the `AddProblemDetails()` customisation also sets, such as `traceId`, now gets the factory... (continued)

96 of 114 branches covered (84.21%)

Branch coverage included in aggregate %.

15 of 15 new or added lines in 1 file covered. (100.0%)

353 of 401 relevant lines covered (88.03%)

30.43 hits per line

Jobs
ID Job ID Ran Files Coverage
1 44690077893.1 20 Nov 2026 06:46AM UTC 22
87.18
GitHub Action Run
Source Files on build 44690077893
  • Tree
  • List 22
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • c777c3cc on github
  • Prev Build on master (#44684916576)
  • Next Build on master (#44691134033)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc