public async Task ConnectionCanAddAnotherConnectionOnAnotherHostToAGroup()
            {
                using (var host1 = new MemoryHost())
                using (var host2 = new MemoryHost())
                {
                    var sharedBus = new DefaultDependencyResolver().Resolve<IMessageBus>();
                    host1.Configure(app =>
                    {
                        var resolver = new DefaultDependencyResolver();
                        var ackHandler = new SignalR.Infrastructure.AckHandler(
                            completeAcksOnTimeout: true,
                            ackThreshold: TimeSpan.FromSeconds(10),
                            ackInterval: TimeSpan.FromSeconds(1));

                        resolver.Register(typeof(SignalR.Infrastructure.IAckHandler), () => ackHandler);
                        resolver.Register(typeof(IMessageBus), () => sharedBus);

                        app.MapSignalR<MyGroupConnection>("/groups", new ConnectionConfiguration
                        {
                            Resolver = resolver
                        });
                    });
                    host2.Configure(app =>
                    {
                        var resolver = new DefaultDependencyResolver();

                        resolver.Register(typeof(IMessageBus), () => sharedBus);

                        app.MapSignalR<MyGroupConnection>("/groups", new ConnectionConfiguration
                        {
                            Resolver = resolver
                        });
                    });

                    using (var connection1 = new Connection("http://foo/groups"))
                    using (var connection2 = new Connection("http://foo/groups"))
                    {
                        var messageTcs = new TaskCompletionSource<string>();

                        connection2.Received += message =>
                        {
                            messageTcs.SetResult(message);
                        };

                        await connection1.Start(host1);
                        await connection2.Start(host2);

                        await connection1.Send(new
                        {
                            // Add to group
                            type = 1,
                            group = "testGroup",
                            connectionId = connection2.ConnectionId
                        });

                        await connection1.Send(new
                        {
                            // Send to group
                            type = 3,
                            group = "testGroup",
                            message = "testMessage"
                        });

                        Assert.True(messageTcs.Task.Wait(TimeSpan.FromSeconds(10)));
                        Assert.Equal("testMessage", messageTcs.Task.Result);
                    }
                }
            }
            public async Task ConnectionCanAddAnotherConnectionOnAnotherHostToAGroup()
            {
                using (var host1 = new MemoryHost())
                    using (var host2 = new MemoryHost())
                    {
                        var sharedBus = new DefaultDependencyResolver().Resolve <IMessageBus>();
                        host1.Configure(app =>
                        {
                            var resolver   = new DefaultDependencyResolver();
                            var ackHandler = new SignalR.Infrastructure.AckHandler(
                                completeAcksOnTimeout: true,
                                ackThreshold: TimeSpan.FromSeconds(10),
                                ackInterval: TimeSpan.FromSeconds(1));

                            resolver.Register(typeof(SignalR.Infrastructure.IAckHandler), () => ackHandler);
                            resolver.Register(typeof(IMessageBus), () => sharedBus);

                            app.MapSignalR <MyGroupConnection>("/groups", new ConnectionConfiguration
                            {
                                Resolver = resolver
                            });
                        });
                        host2.Configure(app =>
                        {
                            var resolver = new DefaultDependencyResolver();

                            resolver.Register(typeof(IMessageBus), () => sharedBus);

                            app.MapSignalR <MyGroupConnection>("/groups", new ConnectionConfiguration
                            {
                                Resolver = resolver
                            });
                        });

                        using (var connection1 = new Connection("http://foo/groups"))
                            using (var connection2 = new Connection("http://foo/groups"))
                            {
                                var messageTcs = new TaskCompletionSource <string>();

                                connection2.Received += message =>
                                {
                                    messageTcs.SetResult(message);
                                };

                                await connection1.Start(host1);

                                await connection2.Start(host2);

                                await connection1.Send(new
                                {
                                    // Add to group
                                    type         = 1,
                                    group        = "testGroup",
                                    connectionId = connection2.ConnectionId
                                });

                                await connection1.Send(new
                                {
                                    // Send to group
                                    type    = 3,
                                    group   = "testGroup",
                                    message = "testMessage"
                                });

                                Assert.True(messageTcs.Task.Wait(TimeSpan.FromSeconds(10)));
                                Assert.Equal("testMessage", messageTcs.Task.Result);
                            }
                    }
            }