public void Test6()
        {
            //清空Log数据
            theController.ClearAllReceivedMessages();
            theController.ClearAllSendMessages();

            //该短信无法发送成功
            theController.DelieveAMessage(new SendMessageDataModel(-1, "10086", "余额查询", "testDll"));
            //打开端口,开始收发短信线程
            theController.StartConnection();
            theController.StartTheSmsThread();
            Assert.IsTrue(theController.GetWorkThreadStatus());
            //在中途加入可以发送成功的一条短信
            Thread.Sleep(3000);
            theController.DelieveAMessage(new SendMessageDataModel(-1, "10086", "YECX", "testDll"));
            Thread.Sleep(60000);
            theController.StopTheSmsThread();
            theController.StopConnection();
            //-----验证短信Logs
            Assert.AreEqual(1, theController.GetLogsForSuccesssSendMessages().Count);
            Assert.AreEqual(2, theController.GetLogsForWaitSendMessages().Count);
            Assert.AreEqual(1, theController.GetLogsForReceiveMessages().Count);
            Assert.AreEqual(1, theController.GetLogsForFailedSendMessages().Count);
        }
예제 #2
0
 protected void btnAddSmsToQueue_Click(object sender, EventArgs e)
 {
     _TheSmsControllor.DelieveAMessage(new SendMessageDataModel(-999, txtSendToQueue.Text, txtSendContextQueue.Text, "smsController"));
     ReflashStatus();
 }