public void TestAuthenticationFailed()
        {
            var authTask = Processor.Authenticate(new AuthenticationMessage {
                Session = "asession", AppKey = "aappkey"
            });

            //wait and get timeout
            Assert.IsFalse(authTask.Wait(10));

            Processor.ReceiveLine("{\"op\":\"status\",\"id\":1,\"statusCode\":\"FAILURE\", \"errorCode\":\"NO_SESSION\"}");

            //wait and pass
            Assert.IsTrue(authTask.Wait(10));

            Assert.AreEqual(StatusMessage.StatusCodeEnum.Failure, authTask.Result.StatusCode);
            Assert.AreEqual(StatusMessage.ErrorCodeEnum.NoSession, authTask.Result.ErrorCode);
            Assert.AreEqual(ConnectionStatus.STOPPED, Processor.Status);
        }
        public void TestAuthentication()
        {
            var authTask = Processor.Authenticate(new AuthenticationMessage {
                Session = "asession", AppKey = "aappkey"
            });

            Console.WriteLine(LastLine);

            //wait and get timeout
            Assert.IsFalse(authTask.Wait(10));

            Processor.ReceiveLine("{\"op\":\"status\",\"id\":1,\"statusCode\":\"SUCCESS\"");


            //wait and pass
            Assert.IsTrue(authTask.Wait(10));
            Assert.AreEqual(StatusMessage.StatusCodeEnum.Success, authTask.Result.StatusCode);
            Assert.AreEqual(ConnectionStatus.AUTHENTICATED, Processor.Status);
        }