Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
fa0a9fc
⬆️ upgrade package versions for net11 baseline
aicia-bot Oct 21, 2026
a515a45
🔧 retarget projects from net9 to net11
aicia-bot Oct 21, 2026
4364f33
♻️ switch conditional compilation from net9 to net10
aicia-bot Oct 21, 2026
f1ad539
📝 update tfm guidance for net10 baseline
aicia-bot Oct 21, 2026
88aabd8
👷 enable preview sdk in ci pipeline
aicia-bot Oct 21, 2026
cbb544d
👷 derive service update version from git tags
aicia-bot Oct 21, 2026
2b2f294
👷 derive release availability from docfx includes
aicia-bot Oct 21, 2026
5d77402
📚 update docfx availability for .net 11
aicia-bot Oct 21, 2026
01d7229
💬 update contributing guide for .net 11 sdk
aicia-bot Oct 21, 2026
d847863
📝 update package readmes for .net 11
aicia-bot Oct 21, 2026
3d46452
📝 update agent guide for .net 11 toolchain
aicia-bot Oct 21, 2026
a3ef339
📦 add 13.0.0 package release notes for net11 support
aicia-bot Oct 22, 2026
e0f27e3
💬 add 13.0.0 changelog entry for net11 baseline
aicia-bot Oct 22, 2026
cd1c6c1
🔧 enforce code style and sonar analyzers at build time
gimlichael Oct 27, 2026
decad97
📦 bump cuemon, microsoft extensions and .net 11 rc packages
gimlichael Oct 27, 2026
82a4c93
🔧 force lf line endings via gitattributes
gimlichael Oct 27, 2026
4169058
🔧 move ci and test environments to ubuntu 26.04
gimlichael Oct 27, 2026
8b00a26
🔧 include global nowarn in app project
gimlichael Oct 27, 2026
261e699
📝 correct 13.0.0 changelog release date to go-live date
gimlichael Oct 27, 2026
5b44714
📝 document lock usage rules in agents guidance
aicia-bot Oct 27, 2026
789e95b
🔧 configure build warnings nuget audit and mtp runner
aicia-bot Oct 27, 2026
2551ac0
🔧 suppress sonar findings with documented justifications
aicia-bot Oct 27, 2026
85dd507
🐛 keep deferred host cancellation token and abort handling
aicia-bot Oct 27, 2026
c663260
🐛 serialize deferred host startup with a dedicated lock
aicia-bot Oct 27, 2026
bb87f77
✅ add tests for deferred host cancellation lock and abort
aicia-bot Oct 27, 2026
7f53b35
🎨 normalize encoding and line endings across the solution
aicia-bot Oct 27, 2026
0b97551
fix MinVerTagPrefix
gimlichael Oct 27, 2026
e9ed95c
🎨 normalize line endings and remove byte order marks
aicia-bot Oct 27, 2026
74521b3
🎨 tidy whitespace in docs, json, and source
aicia-bot Oct 27, 2026
704273e
🔧 extend editorconfig rules to vb and drop obsolete ones
aicia-bot Oct 27, 2026
4051e40
💬 update changelog and contributor guide for net11
aicia-bot Oct 27, 2026
159f959
changelog
gimlichael Oct 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .docfx/BuildDocfxImage.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$version = minver -i -t v -v w
docfx metadata docfx.json
docker buildx build -t xunit-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx .
get-childItem -recurse -path api -include *.yml, .manifest | remove-item
$version = minver -i -t v -v w
docfx metadata docfx.json
docker buildx build -t xunit-docfx:$version --platform linux/arm64,linux/amd64 --load -f Dockerfile.docfx .
get-childItem -recurse -path api -include *.yml, .manifest | remove-item
32 changes: 16 additions & 16 deletions .docfx/Dockerfile.docfx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
ARG NGINX_VERSION=1.31-alpine
FROM --platform=$BUILDPLATFORM dhi.io/nginx:${NGINX_VERSION} AS base
RUN rm -rf /usr/share/nginx/html/*
FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2 AS build
ADD [".", "docfx"]
RUN cd docfx; \
docfx build
FROM dhi.io/nginx:${NGINX_VERSION} AS final
WORKDIR /usr/share/nginx/html
COPY --from=build /build/docfx/wwwroot /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
ARG NGINX_VERSION=1.31-alpine

FROM --platform=$BUILDPLATFORM dhi.io/nginx:${NGINX_VERSION} AS base
RUN rm -rf /usr/share/nginx/html/*

FROM --platform=$BUILDPLATFORM codebeltnet/docfx:2 AS build

ADD [".", "docfx"]

RUN cd docfx; \
docfx build

FROM dhi.io/nginx:${NGINX_VERSION} AS final
WORKDIR /usr/share/nginx/html
COPY --from=build /build/docfx/wwwroot /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
6 changes: 3 additions & 3 deletions .docfx/PublishDocfxImage.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
$version = minver -i -t v -v w
docker tag xunit-docfx:$version jcr.codebelt.net/geekle/xunit-docfx:$version
docker push jcr.codebelt.net/geekle/xunit-docfx:$version
$version = minver -i -t v -v w
docker tag xunit-docfx:$version jcr.codebelt.net/geekle/xunit-docfx:$version
docker push jcr.codebelt.net/geekle/xunit-docfx:$version
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features
summary: *content
---
Simulate the ASP.NET Core HTTP request and response feature surfaces in unit tests without running a real server. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features` namespace provides `FakeHttpRequestFeature` and `FakeHttpResponseFeature`, which implement `IHttpRequestFeature` and `IHttpResponseFeature` with settable properties backed by default values. Use these fakes when your test code reads request headers, the request body, the response status code, or response headers from the `IFeatureCollection` on `HttpContext.Features`.
Start with `FakeHttpRequestFeature` when you need to control the HTTP method, path, query string, or request body in isolation. Use `FakeHttpResponseFeature` when the code under test writes status codes, response headers, or the response body.
[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
Complements: [Microsoft.AspNetCore.Http.Features namespace](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.features) 🔗
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features
summary: *content
---

Simulate the ASP.NET Core HTTP request and response feature surfaces in unit tests without running a real server. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http.Features` namespace provides `FakeHttpRequestFeature` and `FakeHttpResponseFeature`, which implement `IHttpRequestFeature` and `IHttpResponseFeature` with settable properties backed by default values. Use these fakes when your test code reads request headers, the request body, the response status code, or response headers from the `IFeatureCollection` on `HttpContext.Features`.

Start with `FakeHttpRequestFeature` when you need to control the HTTP method, path, query string, or request body in isolation. Use `FakeHttpResponseFeature` when the code under test writes status codes, response headers, or the response body.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]

Complements: [Microsoft.AspNetCore.Http.Features namespace](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.features) 🔗
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http
summary: *content
---
Isolate unit tests from the real `IHttpContextAccessor` and `HttpContext` pipeline. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http` namespace provides `FakeHttpContextAccessor`, a test double that implements `IHttpContextAccessor` with settable `HttpContext` and `HttpContextFactory` properties, letting you simulate request context without hosting a full server. Use this type when your tested code depends on `IHttpContextAccessor` and you need deterministic, fast test setup.
[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
Complements: [Microsoft.AspNetCore.Http namespace](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http) 🔗
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http
summary: *content
---

Isolate unit tests from the real `IHttpContextAccessor` and `HttpContext` pipeline. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore.Http` namespace provides `FakeHttpContextAccessor`, a test double that implements `IHttpContextAccessor` with settable `HttpContext` and `HttpContextFactory` properties, letting you simulate request context without hosting a full server. Use this type when your tested code depends on `IHttpContextAccessor` and you need deterministic, fast test setup.

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]

Complements: [Microsoft.AspNetCore.Http namespace](https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http) 🔗
102 changes: 51 additions & 51 deletions .docfx/api/namespaces/Codebelt.Extensions.Xunit.Hosting.AspNetCore.md
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore
summary: *content
---
Exercise an ASP.NET Core application's real entry point, dependency-injection graph, middleware pipeline, and endpoints through an in-memory `TestServer`. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore` namespace can bootstrap modern minimal hosting and conventional `Startup` applications, apply test-only web-host configuration, and return either an owned test context or a reusable xUnit fixture.
---
uid: Codebelt.Extensions.Xunit.Hosting.AspNetCore
summary: *content
---

Exercise an ASP.NET Core application's real entry point, dependency-injection graph, middleware pipeline, and endpoints through an in-memory `TestServer`. The `Codebelt.Extensions.Xunit.Hosting.AspNetCore` namespace can bootstrap modern minimal hosting and conventional `Startup` applications, apply test-only web-host configuration, and return either an owned test context or a reusable xUnit fixture.

For a focused endpoint or service-override test, start with `WebApplicationTestFactory.Create<TEntryPoint>` or its one-request `RunAsync<TEntryPoint>` convenience. Use `WebApplicationTest<TEntryPoint, TFixture>` with `ManagedWebApplicationFixture<TEntryPoint>` when several tests should share the bootstrapped application. Reach for `WebHostTestFactory` or `MinimalWebHostTestFactory` when the test defines its own pipeline instead of loading an existing application.
[!INCLUDE [availability-modern](../../includes/availability-modern.md)]
Complements: [ASP.NET Core integration tests](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-10.0) · [WebApplicationFactory<TEntryPoint>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.testing.webapplicationfactory-1?view=aspnetcore-10.0) · [Microsoft.AspNetCore.TestHost namespace](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.testhost) 🔗
### Choose an ASP.NET Core Testing Path
|When you need to|Start with|Why|
|---|---|---|
|Bootstrap an existing ASP.NET Core application for one focused test|`WebApplicationTestFactory.Create<TEntryPoint>`|Returns an owned `IHostTest` whose host exposes the application's `TestServer`, services, configuration, and environment.|
|Send one request to an existing application|`WebApplicationTestFactory.RunAsync<TEntryPoint>`|Combines application startup, `HttpClient` creation, request execution, and cleanup in one call.|

[!INCLUDE [availability-modern](../../includes/availability-modern.md)]

Complements: [ASP.NET Core integration tests](https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-10.0) · [WebApplicationFactory<TEntryPoint>](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.testing.webapplicationfactory-1?view=aspnetcore-10.0) · [Microsoft.AspNetCore.TestHost namespace](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.testhost) 🔗

### Choose an ASP.NET Core Testing Path

|When you need to|Start with|Why|
|---|---|---|
|Bootstrap an existing ASP.NET Core application for one focused test|`WebApplicationTestFactory.Create<TEntryPoint>`|Returns an owned `IHostTest` whose host exposes the application's `TestServer`, services, configuration, and environment.|
|Send one request to an existing application|`WebApplicationTestFactory.RunAsync<TEntryPoint>`|Combines application startup, `HttpClient` creation, request execution, and cleanup in one call.|
|Share an existing application across an xUnit test class|`WebApplicationTest<TEntryPoint, TFixture>` with `ManagedWebApplicationFixture<TEntryPoint>`|Uses entrypoint-owned startup while the fixture exposes `TestServer`.|
|Define services and middleware entirely inside the test|`WebHostTestFactory` or `MinimalWebHostTestFactory`|Builds a purpose-specific in-memory pipeline without loading an application project.|
|Attach observers or change state before startup|A `SelfManaged` web fixture|Builds the host and pipeline but leaves startup to the test.|
### Compared with WebApplicationFactory
`WebApplicationTestFactory` is an alternative integration-test entry point, not a drop-in replacement for `Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TEntryPoint>`.
|Concern|`WebApplicationTestFactory`|Microsoft `WebApplicationFactory<TEntryPoint>`|
|---|---|---|
|Acquisition|Static `Create<TEntryPoint>` or `RunAsync<TEntryPoint>` returns a Codebelt test context.|Instantiate or inject a factory, then call `CreateClient`.|
|Customization|Pass an `IWebHostBuilder` callback at the call site.|Subclass and override `ConfigureWebHost`, or compose with `WithWebHostBuilder`.|
|Sharing|Use Codebelt's `WebApplicationTest` and fixture types when tests should share a context.|Commonly shared directly through xUnit `IClassFixture<WebApplicationFactory<TEntryPoint>>`.|
|Lifecycle|The caller disposes the returned context, or delegates ownership to a Codebelt fixture.|The factory owns its `TestServer` and clients and is disposed by the caller or xUnit fixture lifecycle.|
|Scope|Matches Codebelt's equivalent entry-point pattern for console, worker, and Generic Host applications.|Purpose-built for ASP.NET Core applications and includes MVC-testing conventions such as client options and content-root discovery.|
### Fixture Naming Convention
ASP.NET Core host fixtures follow the same lifecycle naming convention as the hosting package:
|Prefix|Convention|
|---|---|
|Define services and middleware entirely inside the test|`WebHostTestFactory` or `MinimalWebHostTestFactory`|Builds a purpose-specific in-memory pipeline without loading an application project.|
|Attach observers or change state before startup|A `SelfManaged` web fixture|Builds the host and pipeline but leaves startup to the test.|

### Compared with WebApplicationFactory

`WebApplicationTestFactory` is an alternative integration-test entry point, not a drop-in replacement for `Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TEntryPoint>`.

|Concern|`WebApplicationTestFactory`|Microsoft `WebApplicationFactory<TEntryPoint>`|
|---|---|---|
|Acquisition|Static `Create<TEntryPoint>` or `RunAsync<TEntryPoint>` returns a Codebelt test context.|Instantiate or inject a factory, then call `CreateClient`.|
|Customization|Pass an `IWebHostBuilder` callback at the call site.|Subclass and override `ConfigureWebHost`, or compose with `WithWebHostBuilder`.|
|Sharing|Use Codebelt's `WebApplicationTest` and fixture types when tests should share a context.|Commonly shared directly through xUnit `IClassFixture<WebApplicationFactory<TEntryPoint>>`.|
|Lifecycle|The caller disposes the returned context, or delegates ownership to a Codebelt fixture.|The factory owns its `TestServer` and clients and is disposed by the caller or xUnit fixture lifecycle.|
|Scope|Matches Codebelt's equivalent entry-point pattern for console, worker, and Generic Host applications.|Purpose-built for ASP.NET Core applications and includes MVC-testing conventions such as client options and content-root discovery.|

### Fixture Naming Convention

ASP.NET Core host fixtures follow the same lifecycle naming convention as the hosting package:

|Prefix|Convention|
|---|---|
|`Managed`|The fixture owns host creation, configuration and disposal while the application entry point owns startup; test-host consumption starts the deferred host when needed.|
|`SelfManaged`|The fixture owns host creation and configuration, but leaves host startup to the test.|
|`SelfManaged`|The fixture owns host creation and configuration, but leaves host startup to the test.|

`WebApplicationTestFactory` uses `ManagedWebApplicationFixture<TEntryPoint>` by default, so the real application entry point owns startup and fixture setup remains lazy. Use `ManagedWebApplicationFixture<TEntryPoint>` explicitly with `WebApplicationTest<TEntryPoint, TFixture>` when tests share the application context; use a `SelfManaged` fixture when the test must control startup itself.

`BlockingManagedWebHostFixture` remains the opt-in blocking variant for the lower-level web host fixture family. It is separate from the application-entry-point fixture, which uses `ManagedWebApplicationFixture<TEntryPoint>` for entrypoint-owned startup.
### Extension Members
|Type|Ext|Methods|
|--:|:-:|---|
|HttpClient|⬇️|`ToHttpResponseMessageAsync`|
|IHostApplicationBuilder|⬇️|`ToHostBuilder`|
|IServiceCollection|⬇️|`AddFakeHttpContextAccessor`|
|IWebApplicationFixture&lt;TEntryPoint&gt;|⬇️|`HasValidState<TEntryPoint>`|
|IWebHostFixture|⬇️|`HasValidState`|
|IWebMinimalHostFixture|⬇️|`HasValidState`|

### Extension Members

|Type|Ext|Methods|
|--:|:-:|---|
|HttpClient|⬇️|`ToHttpResponseMessageAsync`|
|IHostApplicationBuilder|⬇️|`ToHostBuilder`|
|IServiceCollection|⬇️|`AddFakeHttpContextAccessor`|
|IWebApplicationFixture&lt;TEntryPoint&gt;|⬇️|`HasValidState<TEntryPoint>`|
|IWebHostFixture|⬇️|`HasValidState`|
|IWebMinimalHostFixture|⬇️|`HasValidState`|
Loading
Loading