-
-
Notifications
You must be signed in to change notification settings - Fork 119
Add a component parameter builder or make param helpers more easily accessible #36
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Related to #5, where support for new test libs is planned, it will probably be a good idea to make it easier for users wanting to pass parameters to CUTs to do so without having to inherit from a base class in their tests, e.g. following the pattern of:
public void TestMethod()
{
using var ctx = new TestContext();
var params = new ComponentParameterBuilder(this) // 'this' might be needed to capture the execution context for callback parameters.
.With("name", value)
.WithCallback("name", () => {})
.WithCascadingValue(obj)
.WithChildContent("<p>hello world</p>")
// ... etc
.Build(); // Build could be done implicitly through a implicit conversion to ComponentParameter[]
ctx.RenderComponent(params);
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request