In bUnit I want to make a call like this:
var textbox = renderedComponent.FindComponent<DxTextBox>("#myid");
However, FindComponent<T>()
does not have a method that accepts any filtering. Is there any way to do this other than call IRenderedComponent.FindComponents<DxTextBox>()
and then walk the list?
In short, no, there is no other way (at the moment). You could write your own extension method to achieve that (just a rough outline, I did not test that code):
We have this on our radar to some extent: https://github.com/bUnit-dev/bUnit/issues/153
This would allow you to retrieve the
IRenderedComponent
from anIElement
.