-
I'm working on a set of Blazor components and extensions.. And want to have consistent quality so trying to test my components. But run into issues when tried to supply According to the docs it can be done like this:
But I'm getting build error:
Currently using .NET 5 MSTests with bunit 1.0.0-beta-11 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi @majorimi Check out the tip at the top of docs page you link to. I am pretty sure you are missing the That said, I would really recommend using the builder pattern for passing parameter instead. Its strongly typed. E.g.:
|
Beta Was this translation helpful? Give feedback.
-
Hi @egil, Since we are started discussing Blazor testing (with this cool framework 🥇) I have further issues which might be stupid mistakes again... One of my component is: So the issues is for me it seems component is not re-rendered. Unit test run correctly I can debug it. Code is calling into events and public methods my component code runs. Internal variables set as expected which should be reflected on UI. By disabling button and switching content, etc. I have a demo page where component works as expected. Test case 1:
Test case 2:
Do you have any idea what can be the issue? Another issue is that when I tried to force render by adding
Sorry to bother you. Thanks. |
Beta Was this translation helpful? Give feedback.
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.: