Пример #1
0
        public async Task AccountManagerDetach()
        {
            AccountManagerRpcReply reply = await RpcClient.AccountManagerDetachAsync(CancellationToken.None);

            // ErrorCode.InvalidUrl will be returned if not attached to any account manager
            Assert.AreEqual(ErrorCode.InvalidUrl, reply.ErrorCode);
        }
        protected override void RpcProcessRecord()
        {
            AccountManagerRpcReply reply = RpcClient.AccountManagerAttachAsync(Url, UserName, Password, CancellationToken.None).GetAwaiter().GetResult();

            if (reply.ErrorCode != ErrorCode.Success)
            {
                throw new Exception(string.Format("Account manager operation failed. Error code: {0}. Error message: {1}", reply.ErrorCode, string.Join(" ", reply.Messages)));
            }
        }
Пример #3
0
        protected override void RpcProcessRecord()
        {
            if (!ShouldProcess(BoincSession.Host))
            {
                return;
            }

            AccountManagerRpcReply reply = RpcClient.AccountManagerAttachAsync(string.Empty, string.Empty, string.Empty, CancellationToken.None).GetAwaiter().GetResult();

            if (reply.ErrorCode != ErrorCode.Success)
            {
                throw new Exception(string.Format("Account manager operation failed. Error code: {0}. Error message: {1}", reply.ErrorCode, string.Join(" ", reply.Messages)));
            }
        }
        protected override void RpcProcessRecord()
        {
            if (!ShouldProcess(BoincSession.Host))
            {
                return;
            }

            AccountManagerRpcReply reply = RpcClient.AccountManagerSync();

            if (reply.ErrorCode != ErrorCode.Success)
            {
                throw new Exception(string.Format("Account manager operation failed. Error code: {0}. Error message: {1}", reply.ErrorCode, string.Join(" ", reply.Messages)));
            }
        }
Пример #5
0
        public async Task AccountManagerAttach()
        {
            AccountManagerRpcReply reply = await RpcClient.AccountManagerAttachAsync("http://www.gridrepublic.org/", "invalid_username", "invalid_password", CancellationToken.None);

            Assert.AreEqual(ErrorCode.BadEmailAddr, reply.ErrorCode);
        }