public async Task Should_connect_locally_with_test_harness()
        {
            var harness = new ActiveMqTestHarness();

            await harness.Start();

            await harness.Stop();
        }
        public async Task Should_connect_locally_with_test_harness_and_publish_without_consumer()
        {
            var harness = new ActiveMqTestHarness();

            await harness.Start();

            await harness.Bus.Publish(new PingMessage());

            await harness.Stop();
        }
Exemple #3
0
        public async Task Should_connect_locally_with_test_harness_and_a_handler()
        {
            var harness = new ActiveMqTestHarness();
            var handler = harness.Handler <PingMessage>(async context =>
            {
            });
            await harness.Start();

            await harness.InputQueueSendEndpoint.Send(new PingMessage());

            await harness.Stop();
        }
        public async Task Should_connect_locally_with_test_harness_and_a_publisher()
        {
            var harness = new ActiveMqTestHarness();
            var handler = harness.Handler <PingMessage>();

            await harness.Start();

            await harness.Bus.Publish(new PingMessage());

            Assert.That(handler.Consumed.Select().Any(), Is.True);

            await harness.Stop();
        }
Exemple #5
0
        public async Task Should_connect_locally_with_test_harness_and_a_publisher()
        {
            var harness  = new ActiveMqTestHarness();
            var handler  = harness.Handler <PingMessage>();
            var handler2 = harness.Handler <PongMessage>();

            await harness.Start();

            await harness.Bus.Publish(new PingMessage());

            Assert.That(handler.Consumed.Select().Any(), Is.True);

            //            await Task.Delay(20000);

            await harness.Bus.Publish(new PongMessage());

            Assert.That(handler2.Consumed.Select().Any(), Is.True);

            await harness.Stop().UntilCompletedOrTimeout(5000);

            await harness.Stop();
        }
Exemple #6
0
        public async Task Should_connect_locally_with_test_harness_and_a_publisher_happy()
        {
            var harness = new ActiveMqTestHarness();
            HandlerTestHarness <PingMessage> handler = harness.Handler <PingMessage>();

            await harness.Start();

            for (var i = 0; i < 100; i++)
            {
                await harness.Bus.Publish(new PingMessage());
            }

            var count = await handler.Consumed.SelectAsync().Count();

            Assert.That(count, Is.EqualTo(100));

            await harness.Stop().OrTimeout(s: 5);
        }