using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using CPF;
using System.Text;
using HWModules;
using Microsoft.SPOT;
using SWModules;

namespace CPFUnitTests
{
//TODO P1 retune this EJM NOT WORKING    
    [TestClass]
    public class UnitTestBTConsole
    {
        private BTConsole bt;

        [TestMethod]
        public void TestBTConsoleWrite()
        {
            Init();
            bt.SendLine(new StringBuilder("HELLO WORLD"));

        }

        [TestMethod]
        public void TestBTConsoleRead()
        {
            Init();
            Debug.Print("Listening for something, please enter a command starting with <$>.");
            bt.SendLine(new StringBuilder("Listening for something, type it in"));
            System.Threading.Thread.Sleep(30000);


        }
        
        private bool runonce = false;
        private void Init()
        {
            if (runonce) return;
            runonce = true;
            bt = BTConsole.Instance;
            //bt.OpenConsolePort();
            //bt.EnqueueItem += Enqueue;
        }

        private void Enqueue(QRecord qRecord)
        {
            Debug.Print("Got item!");
            Debug.Print(qRecord.ToString());

        }
    }
}
