Apache.NMS.Test.ConnectionTest.TestStartAfterSend C# (CSharp) Method

TestStartAfterSend() private method

private TestStartAfterSend ( [ deliveryMode, [ destinationType ) : void
deliveryMode [
destinationType [
return void
        public void TestStartAfterSend(
			[Values(MsgDeliveryMode.Persistent, MsgDeliveryMode.NonPersistent)]
			MsgDeliveryMode deliveryMode,
			[Values(DestinationType.Queue, DestinationType.Topic)]
			DestinationType destinationType)
        {
            using(IConnection connection = CreateConnection(GetTestClientId()))
            {
                ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge);
                IDestination destination = CreateDestination(session, destinationType);
                IMessageConsumer consumer = session.CreateConsumer(destination);

                // Send the messages
                SendMessages(session, destination, deliveryMode, 1);

                // Start the conncection after the message was sent.
                connection.Start();

                // Make sure only 1 message was delivered.
                Assert.IsNotNull(consumer.Receive(TimeSpan.FromMilliseconds(1000)));
                Assert.IsNull(consumer.ReceiveNoWait());
            }
        }