Ejemplo n.º 1
0
            public void should_throw_when_batch_is_sent_after_bus_is_stopped()
            {
                AddInvoker <FakeCommand>(shouldBeSubscribedOnStartup: false);

                var batch   = new SubscriptionRequestBatch();
                var request = new SubscriptionRequest(Subscription.Any <FakeCommand>());

                request.AddToBatch(batch);

                _bus.Start();
                var _ = _bus.SubscribeAsync(request);

                _bus.Stop();

                var submitTask = batch.SubmitAsync();

                Assert.Throws <AggregateException>(() => submitTask.Wait()).InnerExceptions.ExpectedSingle().ShouldBe <InvalidOperationException>();
            }
Ejemplo n.º 2
0
            public void empty_batch_should_not_block()
            {
                var batch = new SubscriptionRequestBatch();

                batch.SubmitAsync().IsCompleted.ShouldBeTrue();
            }