public void send_a_message_and_get_it_back()
        {
            SetupTransport("lq.tcp://localhost:2032/upstream", ChannelMode.DeliveryGuaranteed);

            var envelope = new Envelope {
                Data = new byte[] { 1, 2, 3, 4, 5 }
            };

            envelope.Headers["foo"] = "bar";

            var receiver = new RecordingReceiver();

            node.StartReceiving(receiver, new RecordingLogger());

            node.Channel.As <LightningQueuesChannel>().Send(envelope.Data, envelope.Headers);
            Wait.Until(() => receiver.Received.Any());

            graph.Dispose();
            queues.Dispose();

            receiver.Received.Any().ShouldBeTrue();

            var actual = receiver.Received.Single();

            actual.Data.ShouldBe(envelope.Data);
            actual.Headers["foo"].ShouldBe("bar");
        }
        public void send_a_message_and_get_it_back()
        {
            var envelope = new Envelope()
            {
                Data = new byte[] { 1, 2, 3, 4, 5 }
            };

            envelope.Headers["foo"] = "bar";

            var receiver = new RecordingReceiver();

            node.StartReceiving(receiver, new RecordingLogger());

            node.Channel.As <LightningQueuesChannel>().Send(envelope.Data, envelope.Headers);
            Wait.Until(() => receiver.Received.Any());

            graph.Dispose();
            queues.Dispose();

            receiver.Received.Any().ShouldBeTrue();

            Envelope actual = receiver.Received.Single();

            actual.Data.ShouldEqual(envelope.Data);
            actual.Headers["foo"].ShouldEqual("bar");
        }
Example #3
0
 public void Dispose()
 {
     _graph.Dispose();
 }