bUnit: ComponentParameterCollectionBuilder.Add() for EventCallbacks doesn't support async callbacks with input

While there are several overloads of the Add() method having Func<Task> callback parameter, the ones accepting Func<object, Task> callback or Func<TValue, Task> callback are just missing - the non-async versions using Action<object> callback and Action<TValue> callback exist, though.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

No different than contributing to main. Just checkout v2 and target that with your PR.

@egil If I’ve understood your reponse correctly, the proposed changes can’t be implemented in version 1.x because they might break someone’s compilcation process if they pass an explicit null value as a parameter to the existing method (compilator wouldn’t know which overloaded version of the method to use).

I’ve heard that you are developing version 2.x of bUnit. Can these changes be introduced in that version? If so, do you have any guideline for contribution for version 2.x of bUnit?

@linkdotnet I think this is safe for us to add. It is basically a bunch of additional Add methinds in ComponentParameterCollectionBuilder. Do you have any objections or concerns?

It’s not about UI/input/form validation but validation=unit-testing (=asserting) that some events transport the right data (not string specific) - and yes, the situation is comparable to OnInitializedAsync where intermediary renders happen while async code is still executing.