Bunit for Radzen Dialog Service

For bunit, I am trying to setup the dialog service for openasync(), but I'm unable to do it .Can anyone help me to do a setup for dialog service openasync.for the below code.

await DialogService.OpenAsync< Counter>();

Below is my test code.

This is how I tried.

private Mock< DialogService> _dialogMock=new Mock< DialogService>();

_dialogMock.setup(x=>x.OpenAsync().Returns(new object());

getting below exception:
'Unsupported expression: x => x.OpenAsync()
Non-overridable members (here: DialogService.OpenAsync) may not be used in setup / verification expressions.'

1 Like

You can check this thread: How to Mock DialogService? (the issue isn't resolved as a pull request was never sent).