コード例 #1
0
        public void PromoteScriptAction()
        {
            var promoteCmdlet = new SetAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName       = ClusterName,
                ResourceGroupName = ResourceGroupName,
                ScriptExecutionId = scriptActionDetail.ScriptExecutionId
            };

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

            promoteCmdlet.ExecuteCmdlet();

            commandRuntimeMock.VerifyAll();
            hdinsightManagementMock.VerifyAll();
            hdinsightManagementMock.Verify(c => c.PromoteScript(ResourceGroupName, ClusterName, scriptActionDetail.ScriptExecutionId),
                                           Times.Once);
        }
コード例 #2
0
        public void PromoteScriptAction()
        {
            var promoteCmdlet = new SetAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime            = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName       = ClusterName,
                ResourceGroupName = ResourceGroupName,
                ScriptExecutionId = scriptActionDetail.ScriptExecutionId.Value
            };

            hdinsightManagementMock.Setup(c => c.PromoteScript(ResourceGroupName, ClusterName, scriptActionDetail.ScriptExecutionId.Value))
            .Verifiable();

            promoteCmdlet.ExecuteCmdlet();

            commandRuntimeMock.VerifyAll();
            hdinsightManagementMock.VerifyAll();
            hdinsightManagementMock.Verify(c => c.PromoteScript(ResourceGroupName, ClusterName, scriptActionDetail.ScriptExecutionId.Value),
                                           Times.Once);
        }
コード例 #3
0
        public void PromoteScriptAction()
        {
            var promoteCmdlet = new SetAzureHDInsightPersistedScriptActionCommand
            {
                CommandRuntime = commandRuntimeMock.Object,
                HDInsightManagementClient = hdinsightManagementMock.Object,
                ClusterName = ClusterName,
                ResourceGroupName = ResourceGroupName,
                ScriptExecutionId = scriptActionDetail.ScriptExecutionId
            };

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

            promoteCmdlet.ExecuteCmdlet();

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