Table of Contents

Class TestRendererExtensions

Namespace
Bunit.Extensions
Assembly
Bunit.Web.dll

Helper methods that make it easier to work directly with a ITestRenderer in bUnit web.

public static class TestRendererExtensions
Inheritance
TestRendererExtensions
Inherited Members

Methods

RenderComponent<TComponent>(ITestRenderer, params ComponentParameter[])

Renders a TComponent with the parameters parameters passed to it.

public static IRenderedComponent<TComponent> RenderComponent<TComponent>(this ITestRenderer renderer, params ComponentParameter[] parameters) where TComponent : IComponent

Parameters

renderer ITestRenderer

The renderer to use.

parameters ComponentParameter[]

The parameters to pass to the component.

Returns

IRenderedComponent<TComponent>

A IRenderedComponent<TComponent> that provides access to the rendered component.

Type Parameters

TComponent

The type of component to render.

RenderComponent<TComponent>(ITestRenderer, Action<ComponentParameterCollectionBuilder<TComponent>>)

Renders a TComponent with the parameters build with the parameterBuilder passed to it.

public static IRenderedComponent<TComponent> RenderComponent<TComponent>(this ITestRenderer renderer, Action<ComponentParameterCollectionBuilder<TComponent>> parameterBuilder) where TComponent : IComponent

Parameters

renderer ITestRenderer

The renderer to use.

parameterBuilder Action<ComponentParameterCollectionBuilder<TComponent>>

The a builder to create parameters to pass to the component.

Returns

IRenderedComponent<TComponent>

A IRenderedComponent<TComponent> that provides access to the rendered component.

Type Parameters

TComponent

The type of component to render.

.NET Foundation

Supported by the .NET Foundation.