-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/egil/bUnit into dev
- Loading branch information
Showing
22 changed files
with
155 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -336,3 +336,5 @@ bunit.docs/log.txt | |
*coverage*.info | ||
.sonarqube | ||
tests/*/coverage | ||
|
||
bunit.v3.ncrunchsolution.user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 0 additions & 48 deletions
48
src/bunit.core/Extensions/RenderedComponentInvokeAsyncExtensions.cs
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/bunit.core/Extensions/RenderedFragmentInvokeAsyncExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Bunit.Rendering; | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
namespace Bunit | ||
{ | ||
/// <summary> | ||
/// InvokeAsync extensions methods on <see cref="IRenderedFragmentBase"/>. | ||
/// </summary> | ||
public static class RenderedFragmentInvokeAsyncExtensions | ||
{ | ||
/// <summary> | ||
/// Invokes the given <paramref name="workItem"/> in the context of the associated <see cref="ITestRenderer"/>. | ||
/// </summary> | ||
/// <param name="renderedFragment">The rendered fragment whose dispatcher to invoke with.</param> | ||
/// <param name="workItem">The work item to execute on the renderer's thread.</param> | ||
/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing or is suspended by an asynchronous operation.</returns> | ||
public static Task InvokeAsync(this IRenderedFragmentBase renderedFragment, Action workItem) | ||
{ | ||
if (renderedFragment is null) | ||
throw new ArgumentNullException(nameof(renderedFragment)); | ||
|
||
return renderedFragment.Services.GetRequiredService<ITestRenderer>() | ||
.Dispatcher.InvokeAsync(workItem); | ||
} | ||
|
||
/// <summary> | ||
/// Invokes the given <paramref name="workItem"/> in the context of the associated <see cref="ITestRenderer"/>. | ||
/// </summary> | ||
/// <param name="renderedFragment">The rendered component whose dispatcher to invoke with.</param> | ||
/// <param name="workItem">The work item to execute on the renderer's thread.</param> | ||
/// <returns>A <see cref="Task"/> that will be completed when the action has finished executing.</returns> | ||
public static Task InvokeAsync(this IRenderedFragmentBase renderedFragment, Func<Task> workItem) | ||
{ | ||
if (renderedFragment is null) | ||
throw new ArgumentNullException(nameof(renderedFragment)); | ||
|
||
return renderedFragment.Services.GetRequiredService<ITestRenderer>() | ||
.Dispatcher.InvokeAsync(workItem); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.