Is interactive: True
-Rendermode: Server
- """); - } - - [Fact(DisplayName = "Renderer throws exception if RendererInfo is not specified")] - public void Test002() - { - Action act = () => RenderComponentIs interactive: True
+Rendermode: Server
+Assigned Render Mode: InteractiveServerRenderMode
); + } + + [Fact(DisplayName = "Assigned Render Mode is inherited all the way down the component hierarchy")] + public void Test008() + { + var cut = Render( + @Assigned Render Mode: InteractiveServerRenderMode
); + } + + [Fact(DisplayName = "Having a component with section outlet and RenderMode is specifying for child component")] + public void Test009() + { + // See: https://learn.microsoft.com/en-us/aspnet/core/blazor/components/sections?view=aspnetcore-8.0#section-interaction-with-other-blazor-features + var cut = Render(@Assigned Render Mode: InteractiveWebAssemblyRenderMode
); + } + + [Fact(DisplayName = "Assigned Render Mode on siblings")] + public void Test010() + { + var cut = Render( + @Assigned Render Mode: InteractiveServerRenderMode
+Assigned Render Mode: InteractiveWebAssemblyRenderMode
+Assigned Render Mode: @AssignedRenderMode?.GetType().Name
+ +@{ +#endif +} diff --git a/tests/bunit.testassets/RenderModes/ComponentWithChildContent.razor b/tests/bunit.testassets/RenderModes/ComponentWithChildContent.razor new file mode 100644 index 000000000..c8b0cd4e1 --- /dev/null +++ b/tests/bunit.testassets/RenderModes/ComponentWithChildContent.razor @@ -0,0 +1,6 @@ +@ChildContent +@code { + + [Parameter] public RenderFragment ChildContent { get; set; } = default!; + +} \ No newline at end of file diff --git a/tests/bunit.testassets/RenderModes/ComponentWithServerRenderMode.razor b/tests/bunit.testassets/RenderModes/ComponentWithServerRenderMode.razor index 3ce1d35a0..dd008df6c 100644 --- a/tests/bunit.testassets/RenderModes/ComponentWithServerRenderMode.razor +++ b/tests/bunit.testassets/RenderModes/ComponentWithServerRenderMode.razor @@ -12,4 +12,4 @@ @{ #endif -} \ No newline at end of file +} diff --git a/tests/bunit.testassets/RenderModes/SectionOutletComponent.razor b/tests/bunit.testassets/RenderModes/SectionOutletComponent.razor new file mode 100644 index 000000000..7e860e07d --- /dev/null +++ b/tests/bunit.testassets/RenderModes/SectionOutletComponent.razor @@ -0,0 +1,12 @@ +@{ +#if NET9_0_OR_GREATER +} + +