Skip to content

Commit c5fdf2d

Browse files
authored
Merge pull request #1753 from bUnit-dev/v2
V2
2 parents 3b824db + 2b48000 commit c5fdf2d

File tree

457 files changed

+5306
-8526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

457 files changed

+5306
-8526
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"features": {
88
"ghcr.io/devcontainers/features/dotnet:2": {
99
"version": "latest",
10-
"additionalVersions": "8.0,7.0,6.0,5.0,3.1"
10+
"additionalVersions": "8.0"
1111
}
1212
},
1313

.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ dotnet_diagnostic.S1075.severity = suggestion # S1075: URIs should not be hardco
454454
dotnet_diagnostic.S1186.severity = suggestion # S1186: Methods should not be empty
455455
dotnet_diagnostic.S2292.severity = suggestion # S2292: Trivial properties should be auto-implemented
456456
dotnet_diagnostic.S3267.severity = suggestion # S3267: Convert foreach loop to LINQ query
457+
dotnet_diagnostic.S2743.severity = suggestion # S2743: A static field in a generic type is not shared among instances
457458
dotnet_diagnostic.S4158.severity = none # BUGGY with C#9 code - doesnt understand local methods
458459

459460
# Razor specific rules
@@ -491,6 +492,7 @@ dotnet_diagnostic.CA1062.severity = none # CA1062: Validate arguments of public
491492
dotnet_diagnostic.CA1707.severity = none # CA1707: Identifiers should not contain underscores
492493
dotnet_diagnostic.CA1812.severity = none # CA1812: Avoid uninstantiated internal classes - components under test are never instantiated directly.
493494
dotnet_diagnostic.CA1822.severity = suggestion # CA1822: Mark members as static
495+
dotnet_diagnostic.CA1859.severity = none # CA1859: Change return type of method
494496
dotnet_diagnostic.CA2007.severity = none # CA2007: Consider calling ConfigureAwait on the awaited task
495497

496498
# Microsoft - FxCop

.github/workflows/ci.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
paths:
99
- 'src/**'
1010
- 'tests/**'
11+
- 'docs/**'
1112

1213
pull_request:
1314
types:
@@ -18,7 +19,7 @@ on:
1819
workflow_dispatch:
1920

2021
concurrency:
21-
group: verification-${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
22+
group: ci-${{ github.workflow }}-${{ (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/v2') && github.run_id || github.event.pull_request.number || github.ref }}
2223
cancel-in-progress: true
2324

2425
env:
@@ -46,6 +47,7 @@ jobs:
4647
dotnet-version: |
4748
8.0.x
4849
9.0.x
50+
10.0.x
4951
5052
- name: ⚙️ Setup GIT versioning
5153
uses: dotnet/[email protected]
@@ -71,10 +73,9 @@ jobs:
7173
# Create the NuGet package in the folder from the environment variable NuGetDirectory
7274
- run: |
7375
dotnet pack src/bunit/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
74-
dotnet pack src/bunit.core/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
75-
dotnet pack src/bunit.web/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7676
dotnet pack src/bunit.template/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7777
dotnet pack src/bunit.web.query/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
78+
dotnet pack src/bunit.generators/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
7879
7980
# Publish the NuGet package as an artifact, so they can be used in the following jobs
8081
- uses: actions/upload-artifact@v4
@@ -112,8 +113,7 @@ jobs:
112113
strategy:
113114
fail-fast: false
114115
matrix:
115-
os: [ubuntu-latest, macos-13, windows-latest]
116-
framework: [net8.0, net9.0]
116+
os: [ubuntu-latest, macos-latest, windows-latest]
117117
runs-on: ${{ matrix.os }}
118118

119119
steps:
@@ -128,14 +128,15 @@ jobs:
128128
dotnet-version: |
129129
8.0.x
130130
9.0.x
131+
10.0.x
131132
132133
- name: ⚙️ Restore packages and tools
133134
run: |
134135
dotnet restore
135136
dotnet tool restore
136137
137138
- name: 🧪 Run unit tests
138-
run: dotnet test -c release --no-restore -f ${{ matrix.framework }}
139+
run: dotnet test -c release --no-restore
139140

140141
- name: 📛 Upload hang- and crash-dumps on test failure
141142
if: success() || failure()
@@ -219,12 +220,9 @@ jobs:
219220
uses: actions/setup-dotnet@v4
220221
with:
221222
dotnet-version: |
222-
3.1.x
223-
5.0.x
224-
6.0.x
225-
7.0.x
226223
8.0.x
227224
9.0.x
225+
10.0.x
228226
229227
- name: ⚙️ Setup GIT versioning
230228
uses: dotnet/[email protected]

.github/workflows/docs-deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ jobs:
7575
dotnet-version: |
7676
8.0.x
7777
9.0.x
78+
10.0.x
7879
7980
- name: 🎨 Setup color
8081
run: |

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ jobs:
6060
dotnet-version: |
6161
8.0.x
6262
9.0.x
63+
10.0.x
6364
6465
- name: 🛠️ Update changelog
6566
uses: thomaseizinger/[email protected]
@@ -96,9 +97,9 @@ jobs:
9697
- name: 🛠️ Packing library in release mode
9798
run: |
9899
dotnet pack src/bunit/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
99-
dotnet pack src/bunit.core/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
100-
dotnet pack src/bunit.web/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
100+
dotnet pack src/bunit.template/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
101101
dotnet pack src/bunit.web.query/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
102+
dotnet pack src/bunit.generators/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
102103
103104
- name: 🛠️ Upload library to NuGet.org repository
104105
run: |

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ All notable changes to **bUnit** will be documented in this file. The project ad
66

77
## [Unreleased]
88

9+
This major release focuses on platform updates and API simplifications.
10+
11+
For a migration guide, see [Upgrading bUnit](https://bunit.dev/docs/migrations/index.html).
12+
13+
### Changed
14+
15+
- Target framework support updated: added support for .NET 10 (`net10.0`) and dropped all versions prior to .NET 8 (`net8.0`).
16+
- Cleanup of the API with simplifications of many API calls and methods. This also includes renaming of some objects to better reflect their purpose.
17+
18+
### Added
19+
20+
- Improved renderer logic that catches more edge cases.
21+
- Improved developer experience in relation to JSInterop.
22+
923
## [1.40.0] - 2025-06-14
1024

1125
### Fixed
@@ -85,6 +99,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad
8599

86100
- CI build changes to force running verification on x64 based AMD CPUs.
87101

102+
### Added
103+
104+
- New overloads for `ComponentParameterCollectionBuilder.Add` that allow passing arguments for asynchronous callback parameters. Reported by [springy76](https://github.com/springy76). By [@Qwertyluk](https://github.com/Qwertyluk).
105+
88106
## [1.28.9] - 2024-04-19
89107

90108
### Fixed
@@ -743,7 +761,7 @@ List of new features.
743761

744762
- Added `Render(RenderFragment)` and `Render<TComponent>(RenderFragment)` methods to `TestContext`, as well as various overloads to the `MarkupMatches` methods, that also takes a `RenderFragment` as the expected value.
745763

746-
The difference between the generic `Render` method and the non-generic one is that the generic returns an `IRenderedComponent<TComponent>`, whereas the non-generic one returns a `IRenderedFragment`.
764+
The difference between the generic `Render` method and the non-generic one is that the generic returns an `IRenderedComponent<TComponent>`, whereas the non-generic one returns a `RenderedFragment`.
747765

748766
Calling `Render<TComponent>(RenderFragent)` is equivalent to calling `Render(RenderFragment).FindComponent<TComponent>()`, e.g. it returns the first component in the render tree of type `TComponent`. This is different from the `RenderComponent<TComponent>()` method, where `TComponent` _is_ the root component of the render tree.
749767

Directory.Build.props

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,19 @@
2525
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
2626
</PropertyGroup>
2727

28-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1'">
29-
<RazorLangVersion>3.0</RazorLangVersion>
30-
</PropertyGroup>
31-
3228
<PropertyGroup Label="Analyzer settings">
3329
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
3430
<EnableNETAnalyzers>true</EnableNETAnalyzers>
35-
<AnalysisLevel>7</AnalysisLevel>
31+
<AnalysisLevel>8</AnalysisLevel>
3632
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
3733
</PropertyGroup>
3834

3935
<!-- Treat warnings as errors are always on when building in release -->
40-
<PropertyGroup Condition="'$(Configuration)' == 'Release' AND $(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit'">
36+
<PropertyGroup Condition="'$(Configuration)' == 'Release' AND $(MSBuildProjectName) != 'bunit.template'">
4137
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4238
</PropertyGroup>
4339

44-
<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit' AND $(MSBuildProjectName) != 'bunit.generators'">
40+
<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit.generators'">
4541
<Using Include="Microsoft.AspNetCore.Components" />
4642
<Using Include="Microsoft.AspNetCore.Components.RenderTree" />
4743
<Using Include="Microsoft.AspNetCore.Components.Rendering" />

0 commit comments

Comments
 (0)