Skip to content

Commit 34292f3

Browse files
committed
Merge branch 'stable'
2 parents 726c0f7 + 74be3b3 commit 34292f3

29 files changed

Lines changed: 425 additions & 2185 deletions

.config/dotnet-tools.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
"commands": [
88
"dotnet-serve"
99
]
10+
},
11+
"docfx": {
12+
"version": "2.67.0",
13+
"commands": [
14+
"docfx"
15+
]
1016
}
1117
}
1218
}

.github/workflows/docs-deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ jobs:
8181
run: dotnet test docs/samples/samples.sln
8282

8383
- name: 🛠️ Building docs
84-
uses: nikeee/docfx-action@v1.0.0
85-
with:
86-
args: docs/site/docfx.json
84+
run: |
85+
dotnet tool update -g docfx --version 2.67.0
86+
docfx docs/site/docfx.json
8787
8888
- name: 🛠️ Deploy to GitHub Pages
8989
if: success()

.github/workflows/verification.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767
- name: 🧪 Run unit tests (sync)
6868
run: |
6969
dotnet test --filter Category!=async -c release
70+
7071
- name: 📛 Upload hang- and crash-dumps on test failure
7172
if: failure()
7273
uses: actions/upload-artifact@v3
@@ -108,7 +109,7 @@ jobs:
108109
dotnet restore ${{ github.workspace }}/TemplateTestMstest --source https://api.nuget.org/v3/index.json --source ${{ github.workspace }}/packages
109110
dotnet test ${{ github.workspace }}/TemplateTestMstest
110111
111-
# DocFx only works well on Windows currently
112-
- name: 📄 Build documentation
113-
if: matrix.os == 'windows-latest'
114-
run: dotnet build docs/site/
112+
- name: 📄 Building docs
113+
run: |
114+
dotnet tool update -g docfx --version 2.67.0
115+
docfx docs/site/docfx.json

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- Pass parameters, cascading values and inject services into components under test
2121
- Mock `IJSRuntime`, Blazor authentication and authorization, and others
2222

23-
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
23+
bUnit builds on top of existing unit testing frameworks such as xUnit, NUnit, and MSTest, which run the Blazor component tests in just the same way as any normal unit test. bUnit runs a test in milliseconds, compared to browser-based UI tests which usually take seconds to run.
2424

2525
**Go to [bUnit.dev](https://bunit.dev) to learn more.**
2626

@@ -31,9 +31,9 @@ bUnit is available on NuGet in various incarnations. Most should just pick the [
3131
| Name | Description | NuGet Download Link |
3232
| ----- | ----- | ---- |
3333
| [bUnit](https://www.nuget.org/packages/bunit/) | Includes the bUnit.core and bUnit.web packages. | [![Nuget](https://img.shields.io/nuget/dt/bunit?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit/) |
34-
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
35-
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
36-
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
34+
| [bUnit.core](https://www.nuget.org/packages/bunit.core/) | Core library that enables rendering a Blazor component in a test context. | [![Nuget](https://img.shields.io/nuget/dt/bunit.core?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.core/) |
35+
| [bUnit.web](https://www.nuget.org/packages/bunit.web/) | Adds support for testing Blazor components for the web. This includes bUnit.core. | [![Nuget](https://img.shields.io/nuget/dt/bunit.web?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.web/) |
36+
| [bUnit.template](https://www.nuget.org/packages/bunit.template/) | Template, which currently creates xUnit-based bUnit test projects only | [![Nuget](https://img.shields.io/nuget/dt/bunit.template?logo=nuget&style=flat-square)](https://www.nuget.org/packages/bunit.template/) |
3737

3838
To get started, head to the [getting started documentation](https://bunit.dev/docs/getting-started) to learn more.
3939

@@ -63,13 +63,6 @@ A huge thank you to the [sponsors of my work with bUnit](https://github.com/spon
6363
<br />
6464
Amazon Web Services
6565
</a>
66-
</td>
67-
<td align="center" width="120">
68-
<a href="https://github.com/hassanhabib">
69-
<img src="https://avatars.githubusercontent.com/u/1453985?s=460" alt="Hassan Rezk Habib (@hassanhabib)" width="72" height="72" class="avatar" />
70-
<br />
71-
Hassan Rezk Habib
72-
</a>
7366
</td>
7467
</tr>
7568
</table>
@@ -87,7 +80,7 @@ These good people have contributed code or documentation to bUnit:
8780
## Code of conduct
8881

8982
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
90-
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
83+
For more information see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct).
9184

9285
## .NET Foundation
9386

docs/.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
root = true
22

33
[*]
4+
tab_size = 2
45
indent_style = space
56
indent_size = 2
7+
indent_width = 2
68
charset = utf-8
79
trim_trailing_whitespace = true
810
insert_final_newline = false
@@ -11,6 +13,11 @@ insert_final_newline = false
1113
trim_trailing_whitespace = false
1214

1315
[*.{cs,razor}]
16+
tab_size = 2
17+
indent_style = space
18+
indent_size = 2
19+
indent_width = 2
20+
1421
dotnet_diagnostic.BL0001.severity = none
1522
dotnet_diagnostic.BL0002.severity = none
1623
dotnet_diagnostic.BL0003.severity = none

docs/site/docfx.json

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@
77
"bunit.core/bunit.core.csproj",
88
"bunit.web/bunit.web.csproj"
99
],
10-
"exclude": [ "**/bin/**", "**/obj/**", "../../src/AngleSharpWrappers", "../../src/bunit", "../../src/bunit.web.testcomponents", "../../src/bunit.template" ],
1110
"src": "../../src"
1211
}
1312
],
1413
"dest": "api",
15-
"properties": {
16-
"TargetFramework": "net7.0"
17-
},
14+
"includePrivateMembers": false,
1815
"disableGitFeatures": false,
19-
"disableDefaultFilter": false
16+
"disableDefaultFilter": false,
17+
"noRestore": true,
18+
"namespaceLayout": "flattened",
19+
"memberLayout": "samePage",
20+
"allowCompilationErrors": false
2021
}
2122
],
23+
2224
"build": {
2325
"content": [
2426
{
@@ -44,19 +46,8 @@
4446
"site.webmanifest",
4547
"*.png",
4648
"CNAME",
47-
"sponsors/**"
48-
]
49-
}
50-
],
51-
"overwrite": [
52-
{
53-
"files": [
54-
"apidoc/**.md"
55-
],
56-
"exclude": [
57-
"obj/**",
58-
"bin/**",
59-
"_site/**"
49+
"sponsors/**",
50+
"favicon.ico"
6051
]
6152
}
6253
],
@@ -65,6 +56,7 @@
6556
"fileMetadataFiles": [],
6657
"template": [
6758
"default",
59+
"modern",
6860
"templates/bunit"
6961
],
7062
"globalMetadata": {
@@ -73,11 +65,11 @@
7365
"_description": "bUnit is a unit testing library for Blazor Components. You can easily define components under test in C# or Razor syntax and verify outcome using semantic HTML diffing/comparison logic. You can interact with and inspect components, trigger event handlers, provide cascading values, inject services, mock IJsRuntime, and perform snapshot testing.",
7466
"_enableSearch": true,
7567
"_appLogoPath": "/images/bunit-logo.png",
76-
"_disableBreadcrumb": true,
77-
"_disableFooter": false
68+
"_disableBreadcrumb": false,
69+
"_disableFooter": false,
70+
"_appFooter": "<small>Documentation updated on #{NBGV_GitCommitDate}# in commit #{NBGV_GitCommitIdShort}#</small>"
7871
},
7972
"postProcessors": [],
80-
"markdownEngineName": "markdig",
8173
"noLangKeyword": false,
8274
"keepFileLink": false,
8375
"cleanupCacheHistory": true,

docs/site/docs.csproj

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/site/docs.sln

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/site/docs/interaction/trigger-renders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Triggering a render life cycle on a component
77

88
To trigger a re-render of a component under test, a reference to it through a <xref:Bunit.IRenderedComponent`1> type is needed. When using the <xref:Bunit.TestContext>'s `RenderComponent<TComponent>()` method, this is the type returned.
99

10-
In `.razor` based tests, using the <xref:Bunit.TestContext>'s <xref:Bunit.TestContext.Render``1(RenderFragment)> method also returns an <xref:Bunit.IRenderedComponent`1> (as opposed to the <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method which returns the more simple <xref:Bunit.IRenderedFragment>).
10+
In `.razor` based tests, using the <xref:Bunit.TestContext>'s <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method also returns an <xref:Bunit.IRenderedComponent`1> (as opposed to the <xref:Bunit.TestContext.Render(Microsoft.AspNetCore.Components.RenderFragment)> method which returns the more simple <xref:Bunit.IRenderedFragment>).
1111

1212
If you have a <xref:Bunit.IRenderedFragment> or a <xref:Bunit.IRenderedComponent`1> in a test, but need a child component's <xref:Bunit.IRenderedComponent`1>, then use the `FindComponent<TComponent>()` or the `FindComponents<TComponent>()` methods, which traverse down the render tree and finds rendered components.
1313

docs/site/docs/providing-input/controlling-component-instantiation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Components are, by default in bUnit, instantiated in the exact same way the regu
99

1010
It is however possible to control how Blazor components build using .NET 5 or newer are instantiated by bUnit. This enables the possibility to replace one component during testing with another, e.g., to replace a 3rd party component during testing with a "[stub component](https://en.wikipedia.org/wiki/Test_stub)", to make the test easier to write and maintain.
1111

12-
The following sections will describe how to use component factories to control instantiation of components during testing.
12+
The following sections will describe how to use component factories to control the instantiation of components during testing.
1313

1414
## Using component factories to control instantiation
1515

0 commit comments

Comments
 (0)