bUnit
bUnit copied to clipboard
Add experimental support for Mobile Blazor Bindings
With #5 / #75 / beta-7, it should be possible to reuse the core parts of the library to add support for Mobile Blazor Bindings, including support for "razor based tests". The initial aim should be to render MBB-based components and do basics assertions against the rendered components.
Related:
- See discussion here for more details: https://github.com/xamarin/MobileBlazorBindings/issues/42
- @Kahbazi has a prototype that also enables something like this: https://github.com/Kahbazi/MobileBlazorBindings.Tests
Future investigations could include looking at how Xamarin apps are tested natively. Are their existing testing libs that can be reused, especially around the assertion parts.
Hi @Eilon, at some point I would like to discuss this with you. My initial investigations showed that this could work well within the bUnit testing infrastructure in bunit.core, but it does require some changes (making things protected/virtual IIRC) to NativeComponentRenderer and/or MobileBlazorBindingsRenderer for me to hook into renderer and give bUnit the control it needs for testing.
@egil that could be quite reasonable. Can you send a PR to Mobile Blazor Bindings to propose those changes? I tried to find the right balance for the design of the components, but the testing scenario isn't one that I have explored much yet, so I'm not surprised if there are a few things missing that would help this scenario.
@Eilon, great. I will get back to this later then other more pressing issues are out of the way.
Sounds good, I look forward to seeing what changes we should make!