You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-12Lines changed: 5 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@
20
20
- Pass parameters, cascading values and inject services into components under test
21
21
- Mock `IJSRuntime`, Blazor authentication and authorization, and others
22
22
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.
24
24
25
25
**Go to [bUnit.dev](https://bunit.dev) to learn more.**
26
26
@@ -31,9 +31,9 @@ bUnit is available on NuGet in various incarnations. Most should just pick the [
31
31
| Name | Description | NuGet Download Link |
32
32
| ----- | ----- | ---- |
33
33
|[bUnit](https://www.nuget.org/packages/bunit/)| Includes the bUnit.core and bUnit.web packages. |[](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. |[](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. |[](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 |[](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. |[](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. |[](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 |[](https://www.nuget.org/packages/bunit.template/)|
37
37
38
38
To get started, head to the [getting started documentation](https://bunit.dev/docs/getting-started) to learn more.
39
39
@@ -63,13 +63,6 @@ A huge thank you to the [sponsors of my work with bUnit](https://github.com/spon
"_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.",
74
66
"_enableSearch": true,
75
67
"_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>"
Copy file name to clipboardExpand all lines: docs/site/docs/interaction/trigger-renders.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ title: Triggering a render life cycle on a component
7
7
8
8
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.
9
9
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>).
11
11
12
12
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.
Copy file name to clipboardExpand all lines: docs/site/docs/providing-input/controlling-component-instantiation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Components are, by default in bUnit, instantiated in the exact same way the regu
9
9
10
10
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.
11
11
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.
13
13
14
14
## Using component factories to control instantiation
0 commit comments