Apache.NMS.ActiveMQ.Test.SimplePriorityMessageDispatchChannelTest.TestEnqueueFront C# (CSharp) Method

TestEnqueueFront() private method

private TestEnqueueFront ( ) : void
return void
        public void TestEnqueueFront()
        {
            SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel();
            MessageDispatch dispatch1 = new MessageDispatch();
            MessageDispatch dispatch2 = new MessageDispatch();

            channel.Start();

            Assert.IsTrue( channel.Empty == true );
            Assert.IsTrue( channel.Count == 0 );

            channel.EnqueueFirst( dispatch1 );

            Assert.IsTrue( channel.Empty == false );
            Assert.IsTrue( channel.Count == 1 );

            channel.EnqueueFirst( dispatch2 );

            Assert.IsTrue( channel.Empty == false );
            Assert.IsTrue( channel.Count == 2 );

            Assert.IsTrue( channel.DequeueNoWait() == dispatch2 );
            Assert.IsTrue( channel.DequeueNoWait() == dispatch1 );
        }