From 14cdc5362dd8e85040d2ffd8ba66c20f0d0972f8 Mon Sep 17 00:00:00 2001 From: Steven Giesel Date: Fri, 13 Dec 2024 14:11:51 +0000 Subject: [PATCH] SQUASH ME --- docs/site/docs/interaction/render-modes.md | 4 ++-- src/bunit.web/TestContextWrapper.cs | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/site/docs/interaction/render-modes.md b/docs/site/docs/interaction/render-modes.md index 7a4a2aede..17beb056e 100644 --- a/docs/site/docs/interaction/render-modes.md +++ b/docs/site/docs/interaction/render-modes.md @@ -1,9 +1,9 @@ --- uid: render-modes -title: Support for render modes and renderer info +title: Support for render modes and renderer info --- -# Support for render modes and the renderer info +# Support for render modes and `RendererInfo` Render modes in Blazor Web Apps determine the hosting model and interactivity of components. The render mode for example can be applied to a component using the `@rendermode` directive. The [`RendererInfo`](https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.components.rendererinfo?view=aspnetcore-9.0) allows the application to determine the interactivity and location of the component. For more details, check out the [Blazor render modes](https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-9.0) documentation. ## Setting the render mode for a component under test diff --git a/src/bunit.web/TestContextWrapper.cs b/src/bunit.web/TestContextWrapper.cs index a6a9c57c0..1ddb194d5 100644 --- a/src/bunit.web/TestContextWrapper.cs +++ b/src/bunit.web/TestContextWrapper.cs @@ -83,6 +83,13 @@ public virtual IRenderedFragment Render(RenderFragment renderFragment) /// public virtual void DisposeComponents() => TestContext?.DisposeComponents(); +#if NET9_0_OR_GREATER + /// + /// Sets the for the renderer. + /// + public virtual void SetRendererInfo(RendererInfo? rendererInfo) => TestContext?.SetRendererInfo(rendererInfo); +#endif + /// /// Dummy method required to allow Blazor's compiler to generate /// C# from .razor files.