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
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
RenderTreeBuilderA 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
ParameterViewThe parameters.
Returns
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.