public void Test4() { theController.StartConnection(); //将Sim所有短信读取到内存中 theController.ReceiveAllMessage(); //清空所有接受到的短信 theController.ClearAllReceivedMessages(); //发送短信 theController.SendAMessage(new SendMessageDataModel(-1, "10086", "YECX", "testDll")); Thread.Sleep(15000); theController.ReceiveAllMessage(); theController.StopConnection(); //应该收到10086的1条回复短信 Assert.AreEqual(1, theController.GetLogsForReceiveMessages().Count); }
private void ReflashStatus() { lblComStatus.Text = _TheSmsControllor.GetPortStatus() ? "打开" : "关闭"; lblWorkThreadStatus.Text = _TheSmsControllor.GetWorkThreadStatus() ? "打开" : "关闭"; lblTheEventHasHandler.Text = _TheSmsControllor.GetTheBoardStatus() ? "是" : "否"; List <SendMessageDataModel> waitSendMessages = _TheSmsControllor.GetLogsForWaitSendMessages(); gvWait.DataSource = waitSendMessages; gvWait.DataBind(); lblWait.Text = waitSendMessages.Count + "条记录"; List <ReceiveMessageDataModel> receivedMessage = _TheSmsControllor.GetLogsForReceiveMessages(); gvReceive.DataSource = receivedMessage; gvReceive.DataBind(); lblReceive.Text = receivedMessage.Count + "条记录"; List <SendMessageDataModel> failedSendMessage = _TheSmsControllor.GetLogsForFailedSendMessages(); gvFailed.DataSource = failedSendMessage; gvFailed.DataBind(); lblFailed.Text = failedSendMessage.Count + "条记录"; List <SendMessageDataModel> successSendMessage = _TheSmsControllor.GetLogsForSuccesssSendMessages(); gvSuccess.DataSource = successSendMessage; gvSuccess.DataBind(); lblSuccess.Text = successSendMessage.Count + "条记录"; }