Been trying to unit test the component rendered inside Blazored Modal. I can of course test the code around it by mocking IModalService but if I want to test the modal component itself, I run into problems. And they stem from calls to BlazoredModalInstance, like to BlazoredModalInstance.CloseAsync(ModalResult).
I would have liked to mock it but since it doesn't implement any interface, I can't. I tried to create a new BlazoredModal component, but it takes the BlazoredModalInstance as a private CascadingParameter which I cannot provide.
I have also tried rendering the BlazoredModalInstance with bUnit, giving it some ModalOptions, and passing the instance to my modal component, but calls to it lead to crashes (null reference).
Is this somehow possible to achieve? Is there a way to provide cascading parameters without the parameters.Add(...) way?