示例#1
0
        public void FetchNewMsgTest()
        {
            SimCorpMobile simCorp = new SimCorpMobile(new FakeOutput());

            simCorp.MsgStor.MsgAdded += OnMsgChanged;
            int expLength = 1;

            simCorp.GenerateSMS();

            Assert.IsTrue(expLength == simCorp.MsgStor.MsgList.Count);
        }
示例#2
0
文件: SMSPhone.cs 项目: TRSASC/Lab5
 private void SMSButton_Click(object sender, EventArgs e)
 {
     SMSButtonClicked = !SMSButtonClicked;
     if (SMSButtonClicked)
     {
         SMSButton.Text = "Stop send SMS";
         SMSGenTask     = new Task(() => {
             while (SMSButtonClicked)
             {
                 simCorp.GenerateSMS();
                 SMSGenTask.Wait(1000);
             }
         });
         SMSGenTask.Start();
     }
     else
     {
         SMSButton.Text = "Send SMS";
     }
 }