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))); } }
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))); } }
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); }