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: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,10 @@ All notable changes to **bUnit** will be documented in this file. The project ad
14
14
15
15
- When the `TestContext` was disposed, the Blazor Renderer itself didn't dispose components under test. By [@linkdotnet](https://github.com/linkdotnet).
16
16
17
+
### Added
18
+
19
+
- New overloads for `IRenderedFragmentBase.InvokeAsync` that allow retrieving the work item's return value. By [@jcparkyn](https://github.com/jcparkyn).
20
+
17
21
## [1.25.3] - 2023-11-14
18
22
19
23
- Upgrade all .NET 8 preview dependencies to .NET 8 stable.
Copy file name to clipboardExpand all lines: docs/site/docs/interaction/trigger-renders.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Let's look at how to use each of these methods to cause a re-render.
19
19
20
20
The [`Render()`](xref:Bunit.RenderedComponentRenderExtensions.Render``1(Bunit.IRenderedComponentBase{``0})) method tells the renderer to re-render the component, i.e. go through its life-cycle methods (except for `OnInitialized()` and `OnInitializedAsync()` methods). To use it, do the following:
The highlighted line shows the call to [`Render()`](xref:Bunit.RenderedComponentRenderExtensions.Render``1(Bunit.IRenderedComponentBase{``0})).
25
25
@@ -30,7 +30,7 @@ The highlighted line shows the call to [`Render()`](xref:Bunit.RenderedComponent
30
30
31
31
The [`SetParametersAndRender(...)`](xref:Bunit.RenderedComponentRenderExtensions.SetParametersAndRender``1(Bunit.IRenderedComponentBase{``0},System.Action{Bunit.ComponentParameterCollectionBuilder{``0}})) methods tells the renderer to re-render the component with new parameters, i.e. go through its life-cycle methods (except for `OnInitialized()` and `OnInitializedAsync()` methods), passing the new parameters —_but only the new parameters_— to the `SetParametersAsync()` method. To use it, do the following:
The highlighted line shows the call to [`SetParametersAndRender()`](xref:Bunit.RenderedComponentRenderExtensions.SetParametersAndRender``1(Bunit.IRenderedComponentBase{``0},System.Action{Bunit.ComponentParameterCollectionBuilder{``0}})), which is also available as a version that takes the zero or more component parameters, e.g. created through the component parameter factory helper methods, if you prefer that method of passing parameters.
36
36
@@ -51,9 +51,25 @@ Let’s look at an example of this, using the `<Calc>` component listed below:
51
51
52
52
To invoke the `Calculate()` method on the component instance, do the following:
/// Invokes the given <paramref name="workItem"/> in the context of the associated <see cref="ITestRenderer"/>.
42
+
/// </summary>
43
+
/// <param name="renderedFragment">The rendered component whose dispatcher to invoke with.</param>
44
+
/// <param name="workItem">The work item to execute on the renderer's thread.</param>
45
+
/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing, with the return value from <paramref name="workItem"/>.</returns>
/// Invokes the given <paramref name="workItem"/> in the context of the associated <see cref="ITestRenderer"/>.
57
+
/// </summary>
58
+
/// <param name="renderedFragment">The rendered component whose dispatcher to invoke with.</param>
59
+
/// <param name="workItem">The work item to execute on the renderer's thread.</param>
60
+
/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing, with the return value from <paramref name="workItem"/>.</returns>
0 commit comments