Skip to content

Cannot test EventCallback parameters. #259

Answered by egil
majorimi asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @majorimi

Check out the tip at the top of docs page you link to. I am pretty sure you are missing the using static Bunit.ComponentParameterFactory; in your code.

That said, I would really recommend using the builder pattern for passing parameter instead. Its strongly typed. E.g.:

var cut= _testContext.RenderComponent<LoadingButton>(parameters => parameters
   .Add(p => p.OnClicked, args => { ... })
);

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@majorimi
Comment options

@egil
Comment options

egil Nov 19, 2020
Maintainer

@majorimi
Comment options

@egil
Comment options

egil Nov 21, 2020
Maintainer

Answer selected by egil
Comment options

You must be logged in to vote
2 replies
@egil
Comment options

egil Nov 19, 2020
Maintainer

@majorimi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #259 on November 18, 2020 21:41.