public void RemoveScriptAction()
        {
            var demoteCmdlet = new RemoveAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName       = ClusterName,
                ResourceGroupName = ResourceGroupName,
                Name = scriptActionDetail.Name
            };

            hdinsightManagementMock.Setup(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name))
            .Returns(new OperationResource
            {
                ErrorInfo  = null,
                StatusCode = HttpStatusCode.OK,
                State      = AsyncOperationState.Succeeded
            })
            .Verifiable();

            demoteCmdlet.ExecuteCmdlet();

            commandRuntimeMock.VerifyAll();
            hdinsightManagementMock.VerifyAll();
            hdinsightManagementMock.Verify(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name),
                                           Times.Once);
        }
        public void RemoveScriptAction()
        {
            var demoteCmdlet = new RemoveAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName       = ClusterName,
                ResourceGroupName = ResourceGroupName,
                Name = scriptActionDetail.Name
            };

            hdinsightManagementMock.Setup(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name))
            .Verifiable();

            demoteCmdlet.ExecuteCmdlet();

            commandRuntimeMock.VerifyAll();
            hdinsightManagementMock.VerifyAll();
            hdinsightManagementMock.Verify(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name),
                                           Times.Once);
        }
        public void RemoveScriptAction()
        {
            var demoteCmdlet = new RemoveAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName = ClusterName,
                ResourceGroupName = ResourceGroupName,
                Name = scriptActionDetail.Name
            };

            hdinsightManagementMock.Setup(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name))
                .Returns(new OperationResource
                {
                    ErrorInfo = null,
                    StatusCode = HttpStatusCode.OK,
                    State = AsyncOperationState.Succeeded
                })
                .Verifiable();

            demoteCmdlet.ExecuteCmdlet();

            commandRuntimeMock.VerifyAll();
            hdinsightManagementMock.VerifyAll();
            hdinsightManagementMock.Verify(c => c.DeletePersistedScript(ResourceGroupName, ClusterName, scriptActionDetail.Name),
                Times.Once);
        }