Table of Contents

Class ComponentDoubleBase<TComponent>

Namespace
Bunit.TestDoubles
Assembly
Bunit.Web.dll

Represents a component that doubles as another component in the render tree.

public abstract class ComponentDoubleBase<TComponent> : IComponent where TComponent : IComponent

Type Parameters

TComponent
Inheritance
ComponentDoubleBase<TComponent>
Implements
Derived
Inherited Members
Extension Methods

Constructors

ComponentDoubleBase()

protected ComponentDoubleBase()

Fields

DoubledType

The type of the doubled component.

protected static readonly Type DoubledType

Field Value

Type

Properties

Parameters

Gets the parameters that was passed to the TComponent that this stub replaced in the component tree.

[Parameter(CaptureUnmatchedValues = true)]
public CapturedParameterView<TComponent> Parameters { get; set; }

Property Value

CapturedParameterView<TComponent>

Methods

BuildRenderTree(RenderTreeBuilder)

Override to generate a DOM tree from the doubled component.

protected virtual void BuildRenderTree(RenderTreeBuilder builder)

Parameters

builder RenderTreeBuilder

A RenderTreeBuilder to build DOM tree.

SetParametersAsync(ParameterView)

Sets parameters supplied by the component's parent in the render tree.

public virtual Task SetParametersAsync(ParameterView parameters)

Parameters

parameters ParameterView

The parameters.

Returns

Task

A Task that completes when the component has finished updating and rendering itself.

Remarks

The SetParametersAsync(ParameterView) method should be passed the entire set of parameter values each time SetParametersAsync(ParameterView) is called. It not required that the caller supply a parameter value for all parameters that are logically understood by the component.

Progress Telerik

Premium sponsor: Progress Telerik.

Packt

Editorial support provided by Packt.

.NET Foundation

Supported by the .NET Foundation.