using System;
using Microsoft.SPOT;

using Microsoft.SPOT.Hardware;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using CPF;

using System.Text;
using System.Threading;
using HWModules;
using SWModules;
using CPF.Surface_States;
using CPF.Profile_States;

using System.Collections;

namespace CPFUnitTests
{
    class MsgQueueUnitTest
    {
        [TestMethod]
        public void TestMsgQ()
        {
            Queue netmicroQ = new Queue();

            MessageQueue msgQ = MessageQueue.Instance;

            StringBuilder sbTemp = new StringBuilder(64);

            Debug.Print("Enqueing");
            Debug.Print(DateTime.Now.ToString("HH:mm:ss.000"));
            for (int i = 0; i < 10000; i++)
            {
                //sbTemp.Clear();
                //sbTemp.Append("This is message ");
                //sbTemp.Append(i.ToString());
                //Debug.Print("Enqueuing: " + sbTemp.ToString());
                //netmicroQ.Enqueue(sbTemp);
                netmicroQ.Enqueue(i);
            }
            Debug.Print(DateTime.Now.ToString("HH:mm:ss.000"));

            Debug.Print("Count = " + netmicroQ.Count.ToString());
            Debug.Print("Dequeing");
            Debug.Print(DateTime.Now.ToString("HH:mm:ss.000"));
            for (int i = 0; i < 10000; i++)
            {
                Debug.Print(netmicroQ.Dequeue().ToString());
            }
            Debug.Print(DateTime.Now.ToString("HH:mm:ss.000"));
        }
    }
}
