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
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ dotnet_diagnostic.BL0004.severity = none
dotnet_diagnostic.BL0005.severity = none
dotnet_diagnostic.BL0006.severity = none
dotnet_diagnostic.BL0007.severity = none
dotnet_diagnostic.BL0010.severity = none

##########################################
# Custom Test Code Analyzers Rules
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
id: nbgv
with:
setAllVars: true
Expand Down Expand Up @@ -128,6 +129,7 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: ⚙️ Restore packages and tools
run: |
Expand Down Expand Up @@ -159,15 +161,15 @@ jobs:
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
9.0.x
10.0.x

- uses: actions/download-artifact@v7
with:
name: ${{ env.NUGET_PACKAGES_ARTIFACT }}
path: ${{ env.NUGET_DIRECTORY }}

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
with:
setAllVars: true

Expand Down Expand Up @@ -222,9 +224,10 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
id: nbgv
with:
setAllVars: true
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
id: nbgv
with:
setAllVars: true
Expand All @@ -76,6 +76,7 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: 🎨 Setup color
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
path: ./CHANGELOG.md

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
id: nbgv
with:
setAllVars: true
Expand All @@ -60,7 +60,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
with:
setAllVars: true

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
git config --global commit.gpgsign true

- name: ⚙️ Setup GIT versioning
uses: dotnet/nbgv@v0.4.2
uses: dotnet/nbgv@v0.5.1
id: nbgv
with:
setAllVars: true
Expand All @@ -66,6 +66,7 @@ jobs:
8.0.x
9.0.x
10.0.x
11.0.x

- name: 🛠️ Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ All notable changes to **bUnit** will be documented in this file. The project ad

## [Unreleased]

## [2.5.3] - 2026-01-21
### Added

- net11.0 support

## [2.5.3] - 2026-01-08

Expand Down
15 changes: 15 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@
<PackageVersion Include="System.Text.Json" Version="10.0.0"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net11.0'">
<PackageVersion Include="Microsoft.Extensions.Logging" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.AspNetCore.Components" Version="11.0.0-preview.1.26104.118"/>

<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.Extensions.Localization.Abstractions" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="11.0.0-preview.1.26104.118"/>
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="11.0.0-preview.1.26104.118"/>

<PackageVersion Include="System.Text.Json" Version="11.0.0-preview.1.26104.118"/>
</ItemGroup>

<ItemGroup Label="Test Dependencies">
<PackageVersion Include="AutoFixture" Version="4.18.1"/>
<PackageVersion Include="AutoFixture.Xunit3" Version="4.19.0"/>
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/components/bunit.docs.samples.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit.Docs.Samples</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>CA1014,NU5104</NoWarn>
Expand Down
2 changes: 1 addition & 1 deletion docs/samples/tests/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<SonarQubeTestProject>true</SonarQubeTestProject>
<IsPackable>false</IsPackable>
Expand Down
12 changes: 11 additions & 1 deletion src/bunit.template/template/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"description": "The target framework sdk for the project.",
"displayName": "Target framework sdk",
"datatype": "choice",
"defaultValue": "net9.0",
"defaultValue": "net10.0",
"replaces": "targetSdk",
"choices": [
{
Expand All @@ -103,6 +103,16 @@
"choice": "net9.0",
"description": ".net 9.0",
"displayName": ".net 9.0"
},
{
"choice": "net10.0",
"description": ".net 10.0",
"displayName": ".net 10.0"
},
{
"choice": "net11.0",
"description": ".net 11.0",
"displayName": ".net 11.0"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src/bunit.web.query/bunit.web.query.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Web.Query</AssemblyName>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ public partial class BunitContext
public BunitAuthorizationContext AddAuthorization()
{
Services.AddCascadingAuthenticationState();
#if !NET11_0_OR_GREATER
Services.AddSingleton<BunitSignOutSessionStateManager>();
#pragma warning disable CS0618
Services.AddSingleton<SignOutSessionStateManager>(s => s.GetRequiredService<BunitSignOutSessionStateManager>());
#pragma warning restore CS0618
#endif
var authCtx = new BunitAuthorizationContext(Services);
return authCtx;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
#if !NET11_0_OR_GREATER
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;

namespace Bunit.TestDoubles;

Expand Down Expand Up @@ -38,3 +39,4 @@ public override Task<bool> ValidateSignOutState()
return Task.FromResult(wasSignedOut);
}
}
#endif
2 changes: 1 addition & 1 deletion src/bunit/bunit.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion tests/bunit.generators.tests/bunit.generators.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Generator.Tests</AssemblyName>
<ImplicitUsings>true</ImplicitUsings>
Expand Down
2 changes: 1 addition & 1 deletion tests/bunit.testassets/BlazorE2E/ElementRefComponent.razor
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@

async Task MakeInteropCall()
{
await JSRuntime.InvokeAsync<object>("setElementValue", _myInput, $"Clicks: {++_count}");
await JSRuntime.InvokeVoidAsync("setElementValue", _myInput, $"Clicks: {++_count}");
}
}
6 changes: 5 additions & 1 deletion tests/bunit.testassets/bunit.testassets.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit.TestAssets</RootNamespace>
<AssemblyName>Bunit.TestAssets</AssemblyName>
<OutputType>Library</OutputType>
Expand All @@ -25,4 +25,8 @@
<PackageReference Include="Serilog.Extensions.Logging" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals('$(TargetFrameworkVersion)', '11.0'))">
<Content Remove="SampleComponents/SignOutSessionManagerLoginDisplay.razor" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !NET11_0_OR_GREATER
namespace Bunit.TestDoubles;

public class BunitSignOutSessionStateManagerTest : BunitContext
Expand Down Expand Up @@ -27,3 +28,4 @@ public async Task ShouldReturnSignOutStateOnValidateSignOutState()
cut.IsSignedOut.ShouldBeFalse();
}
}
#endif
2 changes: 1 addition & 1 deletion tests/bunit.tests/bunit.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Tests</AssemblyName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/bunit.web.query.tests/bunit.web.query.tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0;net11.0</TargetFrameworks>
<RootNamespace>Bunit</RootNamespace>
<AssemblyName>Bunit.Web.Query.Tests</AssemblyName>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "2.5",
"version": "2.6",
"assemblyVersion": {
"precision": "revision"
},
Expand Down
Loading