Esempio n. 1
0
        public async Task ShouldRemoveWorkflow()
        {
            var response = new EmptyResponse();

            _apiClient.Setup(apiClient =>
                             apiClient.Delete <EmptyResponse>("workflows" + "/workflow_id", _authorization, CancellationToken.None))
            .ReturnsAsync(() => response);

            IWorkflowsClient workflowsClient = new WorkflowsClient(_apiClient.Object, _configuration.Object);

            var getResponse = await workflowsClient.RemoveWorkflow("workflow_id");

            getResponse.ShouldNotBeNull();
        }
Esempio n. 2
0
        public async Task ShouldFailRemoveWorkflow_InvalidParams()
        {
            IWorkflowsClient workflowsClient = new WorkflowsClient(_apiClient.Object, _configuration.Object);

            try
            {
                await workflowsClient.RemoveWorkflow("");

                throw new XunitException();
            }
            catch (Exception ex)
            {
                ex.ShouldBeOfType(typeof(CheckoutArgumentException));
                ex.Message.ShouldBe("workflowId cannot be blank");
            }
        }