public RpcClientTest(ITestOutputHelper testOutputHelper) { _testOutputHelper = testOutputHelper; _services = ConfigureServices(new ServiceCollection()).BuildServiceProvider(); var context = _services.GetRequiredService <RpcServerMqttContext>(); var server = new RpcServer(context, _services); Task.Run(() => { server.Wait(); }); Thread.Sleep(3000); }