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
rendererITestRendererThe renderer to use.
parametersComponentParameter[]The parameters to pass to the component.
Returns
- IRenderedComponent<TComponent>
A IRenderedComponent<TComponent> that provides access to the rendered component.
Type Parameters
TComponentThe 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
rendererITestRendererThe renderer to use.
parameterBuilderAction<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
TComponentThe type of component to render.