public async Task SetUp()
        {
            await Task.WhenAll(Task.Run(async() =>
            {
                while (await TestObjectCreated1stConsumer.WaitAsync(500))
                {
                    ;
                }
                await TestObjectCreated1stConsumer.ResetAsync();
            }), Task.Run(async() =>
            {
                while (await TestObjectCreated2ndConsumer.WaitAsync(500))
                {
                    ;
                }
                await TestObjectCreated2ndConsumer.ResetAsync();
            }), Task.Run(async() =>
            {
                while (await TestObjectUpdatedConsumer.WaitAsync(500))
                {
                    ;
                }
                await TestObjectUpdatedConsumer.ResetAsync();
            }), Task.Run(async() =>
            {
                while (await TestObjectSharedConsumer.WaitAsync(500))
                {
                    ;
                }
                await TestObjectSharedConsumer.ResetAsync();
            }));

            _watch.Restart();
        }
        public async Task Publish_Consume_Shared()
        {
            var bus = Host.Services.GetRequiredService <IServiceBus>();
            var msg = new TestObjectShared {
                Id = Guid.NewGuid()
            };
            await bus.Publish(msg);

            //test that the update consumer has received the message only once
            await TestObjectSharedConsumer.WaitAsync(5000);

            Assert.AreEqual(1, TestObjectSharedConsumer.Consumed);
            Assert.AreEqual(1, TestObjectSharedConsumer.Completed);
            Assert.AreEqual(0, TestObjectSharedConsumer.Remaining);
            Assert.NotNull(TestObjectSharedConsumer.LastContext);
            Assert.AreEqual(0, TestObjectSharedConsumer.LastContext.Retries);
            Assert.AreEqual(0, TestObjectSharedConsumer.LastContext.Redeliveries);
        }