internal virtual void HandleAsyncTaskResponse(AzureOperationResponse opResponse, string operationName)
        {
            string msg = string.Empty;

            if (opResponse.StatusCode != HttpStatusCode.Accepted && opResponse.StatusCode != HttpStatusCode.OK)
            {
                msg = string.Format(Resources.FailureMessageSubmitTask, operationName);
            }

            else
            {
                if (opResponse.GetType().Equals(typeof(TaskResponse)))
                {
                    var taskResponse = opResponse as TaskResponse;
                    msg = string.Format(Resources.SuccessMessageSubmitTask, operationName, taskResponse.TaskId);
                    WriteObject(taskResponse.TaskId);
                }

                else if (opResponse.GetType().Equals(typeof(GuidTaskResponse)))
                {
                    var guidTaskResponse = opResponse as GuidTaskResponse;
                    msg = string.Format(Resources.SuccessMessageSubmitTask, operationName, guidTaskResponse.TaskId);
                    WriteObject(guidTaskResponse.TaskId);
                }
            }

            WriteVerbose(msg);
        }
Пример #2
0
        public static void SetUpDefaultRemoteAppCopyUserDisk(Mock<IRemoteAppManagementClient> clientMock, string sourceCollectionName, string destinationCollectionName, string userUpn, bool overwriteExistingUserDisk)
        {
            AzureOperationResponse response = new AzureOperationResponse()
            {
                RequestId = "12345",
                StatusCode = System.Net.HttpStatusCode.Accepted
            };

            ISetup<IRemoteAppManagementClient, Task<AzureOperationResponse>> setup =
                clientMock.Setup(c => c.UserDisks.CopyAsync(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<CancellationToken>()));
            setup.Returns(Task.Factory.StartNew(() => response));
        }
        public static void SetUpDefaultRemoteAppRemoveTemplate(Mock<IRemoteAppManagementClient> clientMock, string imageName, string id)
        {
            AzureOperationResponse response = new AzureOperationResponse()
            {
                 RequestId = "12345",
                 StatusCode = System.Net.HttpStatusCode.Accepted
            };

            ISetup<IRemoteAppManagementClient, Task<AzureOperationResponse>> setup = clientMock.Setup(c => c.TemplateImages.DeleteAsync(It.IsAny<string>(), It.IsAny<CancellationToken>()));
            setup.Returns(Task.Factory.StartNew(() => response));

            return;
        }
 public void Invoke()
 {
     InvokeResponse = routeOperations.DeleteRouteTable(routeTableName);
 }
Пример #5
0
 public void Invoke()
 {
     InvokeResponse = routeOperations.SetRoute(routeTableName, routeName, parameters);
 }
 public void Invoke()
 {
     InvokeResponse = routeOperations.RemoveRouteTableFromSubnet(vnetName, subnetName);
 }
 public void Invoke()
 {
     InvokeResponse = routeOperations.AddRouteTableToSubnet(vnetName, subnetName, parameters);
 }
 public void Invoke()
 {
     InvokeResponse = routeOperations.CreateRouteTable(parameters);
 }