Skip to content

Commit 83252a9

Browse files
committed
Added Template<TValue> helper method to ComponentTestFixture.
1 parent 047bb18 commit 83252a9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/ComponentTestFixture.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,5 +164,18 @@ protected static ComponentParameter ChildContent<TComponent>(params ComponentPar
164164
{
165165
return ComponentParameter.CreateParameter(nameof(ChildContent), parameters.ToComponentRenderFragment<TComponent>());
166166
}
167+
168+
/// <summary>
169+
/// Creates a component parameter which will pass the <paramref name="template"/> <see cref="RenderFragment{TValue}" />
170+
/// to the parameter with the name <paramref name="name"/>.
171+
/// </summary>
172+
/// <typeparam name="TValue"></typeparam>
173+
/// <param name="name">Parameter name</param>
174+
/// <param name="template"><see cref="RenderFragment{TValue}" /> to pass to the parameter</param>
175+
/// <returns>The <see cref="ComponentParameter"/>.</returns>
176+
protected static ComponentParameter Template<TValue>(string name, RenderFragment<TValue> template)
177+
{
178+
return ComponentParameter.CreateParameter(name, template);
179+
}
167180
}
168181
}

0 commit comments

Comments
 (0)