Exemplo n.º 1
0
        public void ClientIDTest()
        {
            WebQQ  target = new WebQQ();
            string actual;

            actual = target.ClientID;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 public FrmLogin()
 {
     InitializeComponent();
     //初始化 对象.
     _Person    = null;
     _WebQQ     = new WebQQ();
     IsNeedCode = true;
 }
Exemplo n.º 3
0
        public void MyQQNumberTest()
        {
            WebQQ  target = new WebQQ();
            string actual;

            actual = target.MyQQNumber;
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="number"></param>
 /// <param name="password"></param>
 public FrmLogin(string number, string password)
 {
     InitializeComponent();
     //初始化 对象.
     _Person           = null;
     _WebQQ            = new WebQQ();
     textNumber.Text   = number;
     textPassword.Text = password;
 }
Exemplo n.º 5
0
        public void GetUserFriendsTest()
        {
            WebQQ      target   = new WebQQ();
            UserFriend expected = null;
            UserFriend actual;

            actual = target.GetUserFriends();
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 6
0
 /// <summary>
 /// 接收QQ消息.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void WebQQ_ReciveMessage(object sender, QQMessageEventArgs e)
 {
     if (ReciveMessage != null)
     {
         WebQQ qq = sender as WebQQ;
         if (qq != null)
         {
             ReciveMessage(qq.MyQQNumber, e);
         }
     }
 }
Exemplo n.º 7
0
        public void CheckLoginImageTest()
        {
            WebQQ  target   = new WebQQ();
            string qqnumber = string.Empty;
            bool   expected = false;
            bool   actual;

            actual = target.CheckLoginImage(qqnumber);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 8
0
        public void GetLoginVCImageTest()
        {
            WebQQ  target   = new WebQQ();
            string qqnumber = string.Empty;
            Image  expected = null;
            Image  actual;

            actual = target.GetLoginVCImage(qqnumber);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 9
0
        public void GetQQNumberTest()
        {
            WebQQ  target   = new WebQQ();
            string uin      = string.Empty;
            string expected = string.Empty;
            string actual;

            actual = target.GetQQNumber(uin);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 10
0
        public void ReLoginTest()
        {
            WebQQ       target   = new WebQQ();
            string      qqnumber = string.Empty;
            string      pp       = string.Empty;
            LoginResult expected = new LoginResult();
            LoginResult actual;

            actual = target.ReLogin(qqnumber, pp);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 11
0
        public void LoginTest()
        {
            WebQQ       target     = new WebQQ();
            string      qqNumber   = string.Empty;
            string      password   = string.Empty;
            string      verifyCode = string.Empty;
            LoginResult expected   = new LoginResult();
            LoginResult actual;

            actual = target.Login(qqNumber, password, verifyCode);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 12
0
        public void GetLoginVCTest()
        {
            WebQQ       target         = new WebQQ();
            string      qqNumber       = string.Empty;
            string      result         = string.Empty;
            string      resultExpected = string.Empty;
            LoginResult expected       = new LoginResult();
            LoginResult actual;

            actual = target.GetLoginVC(qqNumber, out result);
            Assert.AreEqual(resultExpected, result);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 13
0
        public void SendMessageTest()
        {
            WebQQ  target   = new WebQQ();
            string uin      = string.Empty;
            string content  = string.Empty;
            Font   font     = null;
            Color  color    = new Color();
            bool   expected = false;
            bool   actual;

            actual = target.SendMessage(uin, content, font, color);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Exemplo n.º 14
0
        private void AddQQ(WebQQ qq)
        {
            if (!_QQMap.ContainsKey(qq.MyQQNumber))
            {
                _QQMap.Add(qq.MyQQNumber, qq);
                qq.ReciveMessage += WebQQ_ReciveMessage;
            }
            else
            {
                _QQMap[qq.MyQQNumber] = qq;
            }

            GetFriendTask(qq.MyQQNumber);
        }
Exemplo n.º 15
0
 public FrmLogin(Person person)
 {
     InitializeComponent();
     _WebQQ     = new WebQQ();
     IsNeedCode = true;
     //初始化 对象.
     if (person != null)
     {
         _Person           = person;
         textNumber.Text   = person.QQ;
         textPassword.Text = person.Password;
         checkBox1.Checked = person.IsRecord;
         //IsNeedCode = false;
         //GetLoginCodePicture(person.QQ);
     }
 }
Exemplo n.º 16
0
        /// <summary>
        /// 获取好友列表.
        /// </summary>
        /// <param name="qqNumber">指定QQ号码</param>
        public void GetFriend(string qqNumber)
        {
            try
            {
                FriendCollection list;
                if (_FriendMap.ContainsKey(qqNumber))
                {
                    list = _FriendMap[qqNumber];
                }
                else
                {
                    list = new FriendCollection();
                    _FriendMap.Add(qqNumber, list);
                }
                if (_QQMap.ContainsKey(qqNumber))
                {
                    WebQQ qq = _QQMap[qqNumber];

                    if (AddFatherQQ != null)
                    {
                        AddFatherQQ(qqNumber, qq.NickName);
                    }
                    UserFriend uf = qq.GetUserFriends();
                    if (uf != null && uf.Result != null && uf.Result.Info != null)
                    {
                        foreach (var item in uf.Result.Info)
                        {
                            string number = qq.GetQQNumber(item.Uin.ToString());
                            Friend f      = new Friend(qqNumber, number)
                            {
                                Uin      = item.Uin.ToString(),
                                NikeName = item.Nick,
                            };
                            list.Add(f);
                            if (AddFriend != null)
                            {
                                AddFriend(f);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Loger.WriteLog(ex);
            }
        }
Exemplo n.º 17
0
        public Person AutoLogin(Person person, Func <Image, string> func)
        {
            WebQQ  qq = new WebQQ();
            string num;

            if (qq.GetLoginVC(person.QQ, out num) != LoginResult.NotVerifyCode)
            {
                Image image = qq.GetLoginVCImage(person.QQ);
                num = func(image);
            }
            if (qq.Login(person.QQ, person.Password, num) == LoginResult.LoginSucceed)
            {
                person.IsLogin = true;
                person.State   = "在线";
                AddQQ(qq);
            }
            return(person);
        }
Exemplo n.º 18
0
        /// <summary>
        /// 自动执行发送消息的任务.
        /// </summary>
        /// <param name="myQQ"></param>
        private void StartTask(string myQQ)
        {
            if (_QQMap.ContainsKey(myQQ) && _SendMap.ContainsKey(myQQ))
            {
                SendQueue sq   = _SendMap[myQQ];
                WebQQ     qq   = _QQMap[myQQ];
                Task      tast = new Task(() =>
                {
                    SendMsg sm;
                    while (true)
                    {
                        if (sq.Dequeue(out sm))
                        {
                            bool result = false;
                            for (int i = 0; i < 3; i++)
                            {
                                if (qq.SendMessage(sm.FriendQQ, sm.Context, new Font("宋体", 12F), Color.Black))
                                {
                                    result = true;
                                    break;
                                }
                            }
                            if (!result)
                            {
                                if (SendError != null)
                                {
                                    SendError(myQQ, sm.FriendQQ, sm.Context);
                                }
                            }
                        }
                        Thread.Sleep(200);
                    }
                }
                                          );

                tast.Start();
            }
        }
Exemplo n.º 19
0
        public void WebQQConstructorTest()
        {
            WebQQ target = new WebQQ();

            Assert.Inconclusive("TODO: 实现用来验证目标的代码");
        }
Exemplo n.º 20
0
 public void ListenMessageTest()
 {
     WebQQ target = new WebQQ();
 }