Skip to content
Merged

V2 #1753

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
0390263
chore: remove support for .netstandard2.1 and net5.0
egil Jun 15, 2022
45bc3af
refactor: Remove old frameworks
linkdotnet Mar 2, 2024
abf185c
feat: Added Debugger hints
linkdotnet Mar 2, 2024
344448f
feat: remove Snapshop API
linkdotnet May 5, 2023
59f840c
V2 enumerable internal (#1057)
linkdotnet May 5, 2023
ee1ebfa
feat: Merge bunit.core and bunit.web to bunit
linkdotnet Mar 2, 2024
8a2396e
feat: Remove unused abstraction
linkdotnet May 7, 2023
c5402c4
refactor: Rename Fake to Bunit
linkdotnet Mar 3, 2024
580eca6
refactor: Merge TestContext with TestContextBase
linkdotnet Mar 3, 2024
d6478b9
refactor: Remove ITestRenderer interface
linkdotnet Mar 3, 2024
e02f42a
refactor: Remove abstraction around RenderedFragment/RenderedComponent
linkdotnet Mar 3, 2024
67d51f3
refactor: Renamed TestRenderer to BunitRenderer
linkdotnet Mar 3, 2024
8e256ff
refactor: All rendering methods are surfaced as "Render"
linkdotnet Mar 3, 2024
cc9f2cb
refactor: Remove Extensions methods for TestContext and moved them to…
linkdotnet Mar 3, 2024
846b0c5
refactor: Check for duplicates in one pass-through
linkdotnet Mar 3, 2024
be813da
refactor: Remove RenderedComponentActivator
linkdotnet Mar 3, 2024
bb2a899
refactor: Removed ComponentParameter and dependent types from public …
linkdotnet Mar 4, 2024
4d859bd
refactor: Remove net5 files and moved them to their main content
linkdotnet Mar 4, 2024
104686d
feat: Add IAsyncDiposable for TestContext
linkdotnet Mar 6, 2024
3042be5
refactor: Rename TestContext to BunitContext
linkdotnet Mar 8, 2024
a73989f
feat: Add Obsolete attribute for removed RenderComponent methods
linkdotnet Mar 8, 2024
bd66f3f
refactor: Move RenderInsideRenderTreeto BunitContext and make it private
linkdotnet Mar 8, 2024
25e3f5b
fix: Remove dotnet pack of non-existing packages
linkdotnet Mar 8, 2024
7678768
refactor: Remove old versions in ci.yml
linkdotnet Mar 8, 2024
9b0545d
fix: Template use latest dotnet version
linkdotnet Mar 8, 2024
451072f
fix: Docs and references
linkdotnet Mar 8, 2024
d6cb456
fix: Documentation links
linkdotnet Mar 8, 2024
df68fac
fix: Renamed test wrongly
linkdotnet Mar 9, 2024
08e619a
fix: Use preview instead of alpha tag (#1414)
linkdotnet Mar 9, 2024
9599046
refactor: Rename TestServiceProvider to BunitServiceProvider (#1416)
linkdotnet Mar 10, 2024
a68ff32
feat: Add flag to actively wait for async disposal (#1415)
linkdotnet Mar 13, 2024
a2b268e
fix: Use correct version of packages for net9.0
linkdotnet Mar 14, 2024
330e7f3
chore: Update xunit.runner.visualstudio
linkdotnet Mar 14, 2024
d2278b0
fix: Fixes after merge
linkdotnet Mar 22, 2024
80b4f9e
fix: wrong result type returned
egil Apr 12, 2024
c375196
fix: docs samples csproj
egil Apr 12, 2024
3cf2b79
refactor: Merge RenderedFragment and RenderedComponent into IRendered…
linkdotnet Apr 13, 2024
a104c39
refactor: change RenderedComponent to inherit from ComponentState
egil Apr 27, 2024
d94cd10
refactor: Cache ConstructorInfo (#1455)
linkdotnet Apr 28, 2024
2f39544
fix: Add ComponentParameterCollectionBuilder overloaded methods (#1467)
Qwertyluk May 28, 2024
a1e04ed
chore: Upgrade packages
linkdotnet Jul 21, 2024
e827e3e
fix: Remove unused setter
linkdotnet Jul 21, 2024
d248b2f
Merge branch 'main' into v2
egil Jan 17, 2025
90215fe
fix: Broken CI
linkdotnet Jan 17, 2025
6728ad2
chore: Remove obsolete property
linkdotnet Jan 20, 2025
6032323
chore: Upgrade packages and remove obsolete nodes
linkdotnet Feb 21, 2025
656019f
feat: Add net10
linkdotnet May 18, 2025
59792eb
Merge remote-tracking branch 'origin/main' into v2
linkdotnet Jun 1, 2025
acafdb3
docs: Remove obsolete packages
linkdotnet Jun 1, 2025
97345b0
docs: Added migration documentation
linkdotnet Jun 1, 2025
9cf6985
Merge pull request #1721 from bUnit-dev/v2-merge-main
linkdotnet Jun 6, 2025
0f68a6a
Merge pull request #1719 from bUnit-dev/net10
linkdotnet Jun 6, 2025
055c055
fix: MacOS weird whitespace issue
linkdotnet Jun 6, 2025
85f2f2c
Merge pull request #1722 from bUnit-dev/v2-migration-docs
linkdotnet Jun 6, 2025
a8b9834
fix: Check if components got disposed
linkdotnet Jun 27, 2025
806afb2
fix: Update macOS runner to latest version
linkdotnet Jun 27, 2025
5ebeef5
refactor: Modernize logging approach
linkdotnet Jul 1, 2025
92fd9c1
feat: Added WaitForComponent(s)
linkdotnet Jun 27, 2025
47f9c22
docs: added docu
linkdotnet Jun 27, 2025
c771130
feat: Error when no setup is made for JS
linkdotnet Aug 29, 2025
6a97392
Merge remote-tracking branch 'origin/main' into v2
linkdotnet Aug 30, 2025
16cabdb
fix: added missing TFM
linkdotnet Aug 30, 2025
f2e0d6c
chore: Upgrade packages
linkdotnet Aug 30, 2025
69138c5
fixes after merge
linkdotnet Aug 30, 2025
2ab76ed
fix: Remove generators test (like on main)
linkdotnet Aug 30, 2025
3a327a2
fix: CI
linkdotnet Aug 30, 2025
ebadc22
fix: CI
linkdotnet Aug 30, 2025
75796aa
docs: tunit and some adoptions for xunit.v3
linkdotnet Jan 20, 2025
edf7011
feat: Reeanble generators
linkdotnet Aug 30, 2025
6d8cd74
fix: Migrations url in obsolete attr
linkdotnet Aug 30, 2025
ef82078
fix: Error message
linkdotnet Aug 30, 2025
eb0a011
chore: Upgrade package versions
linkdotnet Sep 12, 2025
1fd5ba6
refactor: Made additional types internal
linkdotnet Sep 14, 2025
2b48000
refactor: use xunit.v3 for test suite (#1752)
linkdotnet Sep 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"features": {
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "latest",
"additionalVersions": "8.0,7.0,6.0,5.0,3.1"
"additionalVersions": "8.0"
}
},

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

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

# Microsoft - FxCop
Expand Down
18 changes: 8 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths:
- 'src/**'
- 'tests/**'
- 'docs/**'

pull_request:
types:
Expand All @@ -18,7 +19,7 @@ on:
workflow_dispatch:

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

env:
Expand Down Expand Up @@ -46,6 +47,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
Expand All @@ -71,10 +73,9 @@ jobs:
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: |
dotnet pack src/bunit/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.core/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.web/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.template/ -c Release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.web.query/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.generators/ -c release --output ${{ env.NUGET_DIRECTORY }} -p:ContinuousIntegrationBuild=true -p:publicrelease=true

# Publish the NuGet package as an artifact, so they can be used in the following jobs
- uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -112,8 +113,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, windows-latest]
framework: [net8.0, net9.0]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -128,14 +128,15 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: ⚙️ Restore packages and tools
run: |
dotnet restore
dotnet tool restore

- name: 🧪 Run unit tests
run: dotnet test -c release --no-restore -f ${{ matrix.framework }}
run: dotnet test -c release --no-restore

- name: 📛 Upload hang- and crash-dumps on test failure
if: success() || failure()
Expand Down Expand Up @@ -219,12 +220,9 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
3.1.x
5.0.x
6.0.x
7.0.x
8.0.x
9.0.x
10.0.x

- name: ⚙️ Setup GIT versioning
uses: dotnet/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: 🎨 Setup color
run: |
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
dotnet-version: |
8.0.x
9.0.x
10.0.x

- name: 🛠️ Update changelog
uses: thomaseizinger/[email protected]
Expand Down Expand Up @@ -96,9 +97,9 @@ jobs:
- name: 🛠️ Packing library in release mode
run: |
dotnet pack src/bunit/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.core/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.web/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.template/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.web.query/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true
dotnet pack src/bunit.generators/ -c Release --property:PackageOutputPath=${GITHUB_WORKSPACE}/packages -p:ContinuousIntegrationBuild=true -p:publicrelease=true

- name: 🛠️ Upload library to NuGet.org repository
run: |
Expand Down
20 changes: 19 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ All notable changes to **bUnit** will be documented in this file. The project ad

## [Unreleased]

This major release focuses on platform updates and API simplifications.

For a migration guide, see [Upgrading bUnit](https://bunit.dev/docs/migrations/index.html).

### Changed

- Target framework support updated: added support for .NET 10 (`net10.0`) and dropped all versions prior to .NET 8 (`net8.0`).
- Cleanup of the API with simplifications of many API calls and methods. This also includes renaming of some objects to better reflect their purpose.

### Added

- Improved renderer logic that catches more edge cases.
- Improved developer experience in relation to JSInterop.

## [1.40.0] - 2025-06-14

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

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

### Added

- 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).

## [1.28.9] - 2024-04-19

### Fixed
Expand Down Expand Up @@ -743,7 +761,7 @@ List of new features.

- 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.

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`.
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`.

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.

Expand Down
10 changes: 3 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,19 @@
<AssemblyOriginatorKeyFile>../../key.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'netcoreapp3.1'">
<RazorLangVersion>3.0</RazorLangVersion>
</PropertyGroup>

<PropertyGroup Label="Analyzer settings">
<AnalysisMode>AllEnabledByDefault</AnalysisMode>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>7</AnalysisLevel>
<AnalysisLevel>8</AnalysisLevel>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

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

<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit' AND $(MSBuildProjectName) != 'bunit.generators'">
<ItemGroup Label="Implicit usings" Condition="$(MSBuildProjectName) != 'bunit.template' AND $(MSBuildProjectName) != 'bunit.generators'">
<Using Include="Microsoft.AspNetCore.Components" />
<Using Include="Microsoft.AspNetCore.Components.RenderTree" />
<Using Include="Microsoft.AspNetCore.Components.Rendering" />
Expand Down
Loading
Loading