Chinchilla.Integration.Features.PublisherConfirmsFeature.ShouldWaitForAllMessagesToBeConfirmedWhenDisposing C# (CSharp) Method

ShouldWaitForAllMessagesToBeConfirmedWhenDisposing() private method

        public void ShouldWaitForAllMessagesToBeConfirmedWhenDisposing()
        {
            using (var bus = Depot.Connect("localhost/integration"))
            {
                var publisher = bus.CreatePublisher<HelloWorldMessage>(p => p.Confirm(true));

                var receipts = Enumerable.Range(0, 100)
                    .Select(_ => publisher.Publish(new HelloWorldMessage()))
                    .ToArray();

                publisher.Dispose();

                Assert.That(receipts.All(r => r.IsConfirmed));
            }
        }
    }