public void CanSetAccount() { using (var undoContext = UndoContext.Current) { undoContext.Start(); RemoteAppManagementClient client = GetRemoteAppManagementClient(); GetAccountResult accountResult = client.Account.Get(); Assert.NotNull(accountResult); Assert.NotNull(accountResult.Details); string oldName = accountResult.Details.EndUserFeedName; string newName = "TestWorkspaceName"; AccountDetailsParameter param = new AccountDetailsParameter(); param.AccountInfo = new AccountUpdateDetails();//accountResult.Details; param.AccountInfo.EndUserFeedName = newName; OperationResultWithTrackingId result = client.Account.Set(param); Assert.NotNull(result); accountResult = client.Account.Get(); Assert.Equal(newName, accountResult.Details.EndUserFeedName); param.AccountInfo.EndUserFeedName = oldName; result = client.Account.Set(param); Assert.NotNull(result); } }
public static void SetUpDefaultEditWorkspace(Mock<IRemoteAppManagementClient> clientMock, string endUserFeedName) { ISetup<IRemoteAppManagementClient, Task<OperationResultWithTrackingId>> Setup = null; AccountDetailsParameter details = new AccountDetailsParameter() { AccountInfo = new AccountDetails() { EndUserFeedName = endUserFeedName } }; OperationResultWithTrackingId response = new OperationResultWithTrackingId() { StatusCode = System.Net.HttpStatusCode.Accepted, TrackingId = "34167", RequestId = "111-2222-4444" }; mockTrackingId = new List<TrackingResult>() { new TrackingResult(response) }; Setup = clientMock.Setup(c => c.Account.SetAsync(It.IsAny<AccountDetailsParameter>(), It.IsAny<CancellationToken>())); Setup.Returns(Task.Factory.StartNew(() => response)); }
public override void ExecuteCmdlet() { AccountDetailsParameter details = new AccountDetailsParameter() { AccountInfo = new AccountDetails() { EndUserFeedName = WorkspaceName } }; CallClient(() => Client.Account.Set(details), Client.Account); }
/// <summary> /// Sets the new details of the account. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.RemoteApp.IAccountsOperations. /// </param> /// <param name='accountInfo'> /// Required. New details of account. /// </param> /// <returns> /// The response containing the operation tracking id. /// </returns> public static Task<OperationResultWithTrackingId> SetAsync(this IAccountsOperations operations, AccountDetailsParameter accountInfo) { return operations.SetAsync(accountInfo, CancellationToken.None); }
/// <summary> /// Sets the new details of the account. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.RemoteApp.IAccountsOperations. /// </param> /// <param name='accountInfo'> /// Required. New details of account. /// </param> /// <returns> /// The response containing the operation tracking id. /// </returns> public static OperationResultWithTrackingId Set(this IAccountsOperations operations, AccountDetailsParameter accountInfo) { return Task.Factory.StartNew((object s) => { return ((IAccountsOperations)s).SetAsync(accountInfo); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }