Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .docfx/Dockerfile.docfx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG NGINX_VERSION=1.30.0-alpine
ARG NGINX_VERSION=1.31.0-alpine

FROM --platform=$BUILDPLATFORM nginx:${NGINX_VERSION} AS base
RUN rm -rf /usr/share/nginx/html/*
Expand Down
45 changes: 21 additions & 24 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ This ensures consistent setup, teardown, and output handling across all tests.
using Codebelt.Extensions.Xunit;
using Xunit;

namespace Your.Namespace
namespace Your.Namespace;

public class YourTestClass : Test
{
public class YourTestClass : Test
public YourTestClass(ITestOutputHelper output) : base(output)
{
public YourTestClass(ITestOutputHelper output) : base(output)
{
}

// Your tests here
}

// Your tests here
}
```

Expand All @@ -47,21 +46,20 @@ namespace Your.Namespace

## 5. File and Namespace Organization

- **Always use file-scoped namespaces** (`namespace YourProject.Foo.Bar;`) — the entire codebase has been refactored to file-scoped namespaces. Never use block-scoped namespaces.
- Place test files in the appropriate test project and folder structure.
- Use namespaces that mirror the source code structure. The namespace of a test file MUST match the namespace of the System Under Test (SUT). Do NOT append ".Tests", ".Benchmarks" or similar suffixes to the namespace. Only the assembly/project name should indicate that the file is a test/benchmark (for example: YourProject.Foo.Tests assembly, but namespace YourProject.Foo).
- Example: If the SUT class is declared as:
```csharp
namespace YourProject.Foo.Bar
{
public class Zoo { /* ... */ }
}
namespace YourProject.Foo.Bar;

public class Zoo { /* ... */ }
```
then the corresponding unit test class must use the exact same namespace:
```csharp
namespace YourProject.Foo.Bar
{
public class ZooTest : Test { /* ... */ }
}
namespace YourProject.Foo.Bar;

public class ZooTest : Test { /* ... */ }
```
- Do NOT use:
```csharp
Expand Down Expand Up @@ -91,16 +89,16 @@ using System.Globalization;
using Codebelt.Extensions.Xunit;
using Xunit;

namespace YourProject
namespace YourProject;

/// <summary>
/// Tests for the <see cref="DateSpan"/> class.
/// </summary>
public class DateSpanTest : Test
{
/// <summary>
/// Tests for the <see cref="DateSpan"/> class.
/// </summary>
public class DateSpanTest : Test
public DateSpanTest(ITestOutputHelper output) : base(output)
{
public DateSpanTest(ITestOutputHelper output) : base(output)
{
}
}

[Fact]
public void Parse_ShouldGetOneMonthOfDifference_UsingIso8601String()
Expand Down Expand Up @@ -132,7 +130,6 @@ namespace YourProject

TestOutput.WriteLine(span.ToString());
}
}
}
```

Expand Down
16 changes: 11 additions & 5 deletions .nuget/Codebelt.Extensions.Xunit.App/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Version: 11.0.9
Version: 11.0.10
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)


# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.9
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.8
Availability: .NET 10 and .NET 9

Expand Down
2 changes: 1 addition & 1 deletion .nuget/Codebelt.Extensions.Xunit.App/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ It is, by heart, free, flexible and built to extend and boost your agile codebel

## **Codebelt.Extensions.Xunit.App** for .NET

`Codebelt.Extensions.Xunit.App`, aka `Extensions for xUnit API by Codebelt`, is a toolbelt of assemblies designed to extend upon [xUnit.net](https://xunit.net/) for more advanced unit test scenarios while also being the preferred unit test platform of [Cuemon for .NET](https://github.com/gimlichael/Cuemon).
`Codebelt.Extensions.Xunit.App`, aka `Extensions for xUnit API by Codebelt`, is a toolbelt of assemblies designed to extend upon [xUnit.net](https://xunit.net/) for more advanced unit test scenarios while also being the preferred unit test platform of [Cuemon for .NET](https://github.com/codebeltnet/cuemon).

More documentation available at our documentation site:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Version: 11.0.9
Version: 11.0.10
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)


# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.9
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.8
Availability: .NET 10 and .NET 9

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ More documentation available at our documentation site:

### CSharp Example

Source: [ServerTimingMiddlewareTest.cs](https://github.com/gimlichael/Cuemon/blob/main/test/Cuemon.AspNetCore.Tests/Diagnostics/ServerTimingMiddlewareTest.cs)
Source: [ServerTimingMiddlewareTest.cs](https://github.com/codebeltnet/cuemon/blob/main/test/Cuemon.AspNetCore.Tests/Diagnostics/ServerTimingMiddlewareTest.cs)

```csharp
[Fact]
Expand Down
16 changes: 11 additions & 5 deletions .nuget/Codebelt.Extensions.Xunit.Hosting/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Version: 11.0.9
Version: 11.0.10
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)


# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.9
Availability: .NET 10, .NET 9 and .NET Standard 2.0

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.8
Availability: .NET 10, .NET 9 and .NET Standard 2.0

Expand Down
8 changes: 4 additions & 4 deletions .nuget/Codebelt.Extensions.Xunit.Hosting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ More documentation available at our documentation site:
### CSharp Example

```csharp
public class HostTestTest : HostTest<HostFixture>
public class HostTestTest : HostTest<ManagedHostFixture>
{
private readonly IServiceProvider _provider;

public HostTestTest(HostFixture hostFixture, ITestOutputHelper output) : base(hostFixture, output)
public HostTestTest(ManagedHostFixture hostFixture, ITestOutputHelper output) : base(hostFixture, output)
{
_provider = hostFixture.ServiceProvider;
_provider = hostFixture.Host?.Services;
_provider.GetRequiredService<ITestOutputHelperAccessor>().TestOutput = output;
}

Expand All @@ -47,4 +47,4 @@ public class HostTestTest : HostTest<HostFixture>
}
```

A similar but real life example can be found here: [AspNetCoreHostTestTest.cs](https://github.com/codebeltnet/xunit/tree/main/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/AspNetCoreHostTestTest.cs)
A similar but real life example can be found here: [WebHostTestTest.cs](https://github.com/codebeltnet/xunit/blob/main/test/Codebelt.Extensions.Xunit.Hosting.AspNetCore.Tests/WebHostTestTest.cs)
16 changes: 11 additions & 5 deletions .nuget/Codebelt.Extensions.Xunit/PackageReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
Version: 11.0.9
Version: 11.0.10
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)


# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.9
Availability: .NET 10 and .NET 9

# ALM
- CHANGED Dependencies have been upgraded to the latest compatible versions for all supported target frameworks (TFMs)

Version: 11.0.8
Availability: .NET 10 and .NET 9

Expand Down
5 changes: 2 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,8 @@ dotnet test --collect:"XPlat Code Coverage"
- Keep existing style in files; many modern analyzers are explicitly disabled.

### Namespace Style
- **Prefer file-scoped namespaces** (`namespace Codebelt.Extensions.Xunit;`) for new files.
- The current majority of the codebase uses **block-scoped namespaces** — do not convert existing files unless explicitly asked.
- When editing an existing file, follow whichever style that file already uses.
- **Always use file-scoped namespaces** (`namespace Codebelt.Extensions.Xunit;`) — the entire codebase has been refactored to file-scoped namespaces.
- **Never use block-scoped namespaces** for new or edited files.
- **Never use top-level statements.** Always use explicit class declarations with a proper namespace.

### Disabled Analyzers (key rules — do NOT introduce these patterns)
Expand Down
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ For more details, please refer to `PackageReleaseNotes.txt` on a per assembly ba
> [!NOTE]
> Changelog entries prior to version 8.4.0 was migrated from previous versions of Cuemon.Extensions.Xunit, Cuemon.Extensions.Xunit.Hosting, and Cuemon.Extensions.Xunit.Hosting.AspNetCore.

## [11.0.10] - 2026-05-21

This is a patch release focused on codebase modernization, enhanced testing coverage, and developer workflow improvements.

### Changed

- Refactored entire codebase across all three assemblies to use file-scoped namespaces for consistency with modern C# style conventions,
- Updated developer instructions in `.github/copilot-instructions.md` and `AGENTS.md` to mandate file-scoped namespaces throughout the project,
- Upgraded NGINX base image in documentation build Dockerfile to version 1.31.0-alpine for improved security and stability,
- Normalized whitespace and line endings across dependency configuration and package metadata files for consistency.

### Added

- Comprehensive unit tests for ASP.NET Core hosting fixtures including BlockingManagedWebHostFixture, SelfManagedWebHostFixture, SelfManagedWebMinimalHostFixture, HostBuilderApplicationExtensions, and FakeHttpResponseFeature to ensure robust hosting infrastructure,
- Unit test coverage for HTTP response feature mocking and request/response handling.

### Fixed

- Updated package README examples to reflect current API usage patterns with ManagedHostFixture and correct service provider access,
- Corrected GitHub repository references in package documentation to point to the codebeltnet organization namespace.

## [11.0.9] - 2026-04-16

This is a service update that focuses on package dependencies.
Expand Down Expand Up @@ -360,3 +381,15 @@ This major release is first and foremost focused on ironing out any wrinkles tha

- Added null conditional operator to the ServiceProvider property on the HostFixture class in the Codebelt.Extensions.Xunit.Hosting namespace


[Unreleased]: https://github.com/codebeltnet/xunit/compare/v11.0.10...HEAD
[11.0.10]: https://github.com/codebeltnet/xunit/compare/v11.0.9...v11.0.10
[11.0.9]: https://github.com/codebeltnet/xunit/compare/v11.0.8...v11.0.9
[11.0.8]: https://github.com/codebeltnet/xunit/compare/v11.0.7...v11.0.8
[11.0.7]: https://github.com/codebeltnet/xunit/compare/v11.0.6...v11.0.7
[11.0.6]: https://github.com/codebeltnet/xunit/compare/v11.0.5...v11.0.6
[11.0.5]: https://github.com/codebeltnet/xunit/compare/v11.0.4...v11.0.5
[11.0.4]: https://github.com/codebeltnet/xunit/compare/v11.0.3...v11.0.4
[11.0.3]: https://github.com/codebeltnet/xunit/compare/v11.0.2...v11.0.3
[11.0.2]: https://github.com/codebeltnet/xunit/compare/v11.0.1...v11.0.2
[11.0.1]: https://github.com/codebeltnet/xunit/compare/v11.0.0...v11.0.1
40 changes: 20 additions & 20 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,40 @@
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.15.8" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.15.8" />
<PackageVersion Include="Codebelt.Extensions.BenchmarkDotNet.Console" Version="1.2.5" />
<PackageVersion Include="Cuemon.Core" Version="10.5.1" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore" Version="10.5.1" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="10.5.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageVersion Include="Codebelt.Extensions.BenchmarkDotNet.Console" Version="1.2.6" />
<PackageVersion Include="Cuemon.Core" Version="10.5.2" />
<PackageVersion Include="Cuemon.Extensions.AspNetCore" Version="10.5.2" />
<PackageVersion Include="Cuemon.Extensions.IO" Version="10.5.2" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageVersion Include="MinVer" Version="7.0.0" />
<PackageVersion Include="NativeLibraryLoader" Version="1.0.13" />
<PackageVersion Include="Xunit.v3.Priority" Version="1.1.18" />
<PackageVersion Include="coverlet.collector" Version="10.0.0" />
<PackageVersion Include="coverlet.msbuild" Version="10.0.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
<PackageVersion Include="coverlet.msbuild" Version="10.0.1" />
<PackageVersion Include="xunit.v3" Version="3.2.2" />
<PackageVersion Include="xunit.v3.assert" Version="3.2.2" />
<PackageVersion Include="xunit.v3.extensibility.core" Version="3.2.2" />
<PackageVersion Include="xunit.v3.runner.console" Version="3.2.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('netstandard2'))">
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.6" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.8" />
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net9'))">
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.15" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.15" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="9.0.16" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.16" />
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.16" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="9.0.16" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.16" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.16" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith('net10')) OR $(TargetFramework.StartsWith('netstandard2'))">
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.6" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.FileExtensions" Version="10.0.8" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="10.0.8" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="10.0.8" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;

namespace Codebelt.Extensions.Xunit.Hosting.AspNetCore
namespace Codebelt.Extensions.Xunit.Hosting.AspNetCore;

/// <summary>
/// Extends the default implementation of the <see cref="IWebHostFixture"/> interface to be synchronous e.g., blocking where exceptions can be captured.
/// </summary>
/// <seealso cref="ManagedWebHostFixture" />
public sealed class BlockingManagedWebHostFixture : ManagedWebHostFixture
{
/// <summary>
/// Extends the default implementation of the <see cref="IWebHostFixture"/> interface to be synchronous e.g., blocking where exceptions can be captured.
/// Initializes a new instance of the <see cref="BlockingManagedWebHostFixture"/> class.
/// </summary>
/// <seealso cref="ManagedWebHostFixture" />
public sealed class BlockingManagedWebHostFixture : ManagedWebHostFixture
public BlockingManagedWebHostFixture()
{
/// <summary>
/// Initializes a new instance of the <see cref="BlockingManagedWebHostFixture"/> class.
/// </summary>
public BlockingManagedWebHostFixture()
AsyncHostRunnerCallback = (host, _) =>
{
AsyncHostRunnerCallback = (host, _) =>
{
host.Start();
return Task.CompletedTask;
};
}
host.Start();
return Task.CompletedTask;
};
}
}
Loading
Loading