Beispiel #1
0
        public void TestLogin()
        {
            var client = new CCProto();

            Assert.AreNotEqual(APIConstants.ccERR_OK, client.Login("api.decaptcher.com", _port, string.Empty, string.Empty));
            Assert.AreEqual(APIConstants.ccERR_OK, client.Login("api.decaptcher.com", _port, _username, _password));
            Assert.AreEqual(APIConstants.ccERR_OK, client.Close());
        }
Beispiel #2
0
        public void TestDecodeCaptcha()
        {
            var client = new CCProto();

            Assert.AreEqual(APIConstants.ccERR_OK, client.Login("api.decaptcher.com", _port, _username, _password));
            var result = client.picture2(File.ReadAllBytes("../../../sample.png"), 30, (int)PictureType.Unspecified);

            Assert.AreEqual(APIConstants.ccERR_OK, result.returnCode);
            Assert.AreEqual("3sqb7u7", result.text.ToLowerInvariant());
            Assert.AreEqual(APIConstants.ccERR_OK, client.Close());
        }
Beispiel #3
0
        public void TestCheckBalance()
        {
            var client = new CCProto();

            Assert.AreEqual(APIConstants.ccERR_OK, client.Login("api.decaptcher.com", _port, _username, _password));
            var balance = client.GetBalance();

            Assert.AreEqual(APIConstants.ccERR_OK, balance.ReturnCode);
            Assert.IsTrue(double.Parse(balance.Balance) > 0);
            Assert.AreEqual(APIConstants.ccERR_OK, client.Close());
        }