I am using SignalR in my ASP.NET Core (3.1) Web API application, and everything is working just fine.
However, I need a way to create an instance of the hub context in my unit tests, (since unit tests don't support DI) and I haven't found anything useful in the documentation.
For example, I have this manager class:
public MyManager(IHubContext<ChatHub> hubContext)
{
this.hubContext = hubContext;
...
}
which I should instantiate in my unit tests, but don't know how without the hub context.
Also, I don't actually need to mock SignalR calls, it doesn't matter if they don't work in the tests. I just want my tests not to fail.