Example #1
0
        public void ManyYieldsSingleReceiveDelete()
        {
            IQueue q = _queue;

            List <Message> sm = new List <Message>();

            for (int i = 0; i < ManyYeildCount; i++)
            {
                sm.AddRange(YieldMessages());
            }

            sm.ForEach((m) => q.Send(m));

            List <Message> rm = new List <Message>();

            for (int i = 0; i < sm.Count * 2; i++)
            {
                IReceipt rt = q.Receive();

                if (rt != null)
                {
                    rm.Add(rt.GetMessage <Message>());
                    rt.Delete();
                }
            }

            AssertSentReceivedMessages(
                sm,
                rm);
        }