MockerBlazorTestBase<(Of <(<'T>)>)>..::..GetComponent<(Of <(<'TComponent>)>)> Method (Func<(Of <(<'IElement, Boolean>)>)>)

Gets the component.

Namespace:  FastMoq.Web.Blazor
Assembly:  FastMoq.Web (in FastMoq.Web.dll)

Syntax


public IRenderedComponent<TComponent> GetComponent<TComponent>(
	Func<IElement, bool> predicate
)
where TComponent : IComponent, IComponent, IComponent
Public Function GetComponent(Of TComponent As {IComponent, IComponent, IComponent}) ( _
	predicate As Func(Of IElement, Boolean) _
) As IRenderedComponent(Of TComponent)
public:
generic<typename TComponent>
where TComponent : IComponent, IComponent, IComponent
IRenderedComponent<TComponent>^ GetComponent(
	Func<IElement^, bool^>^ predicate
)

Type Parameters

TComponent
The type of the t component.

Parameters

predicate
Type: Func<(Of <(<'IElement, Boolean>)>)>
The predicate.

Return Value

IRenderedComponent<TComponent>.

Examples


Get FetchData component with inner html containing text. />
C#
var comp = GetComponent<FetchData>(element => element.InnerHtml.Contains("hello"));