예제 #1
0
        public async Task ShouldReflow()
        {
            ReflowBySubjectsRequest reflowBySubjectsRequest =
                new ReflowBySubjectsRequest {
                Subjects = new List <string>(), Workflows = new List <string>()
            };
            ReflowResponse response = new ReflowResponse();

            _apiClient.Setup(apiClient =>
                             apiClient.Post <ReflowResponse>("workflows/events/reflow", _authorization, reflowBySubjectsRequest,
                                                             CancellationToken.None, null))
            .ReturnsAsync(() => response);

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

            var getResponse = await workflowsClient.Reflow(reflowBySubjectsRequest);

            getResponse.ShouldNotBeNull();
        }
        public async Task ShouldReflowSubjects()
        {
            CreateWorkflowResponse createWorkflowResponse = await CreateWorkflow();

            PaymentResponse payment = await MakeCardPayment();

            ReflowBySubjectsRequest request = new ReflowBySubjectsRequest
            {
                Subjects = new List <string> {
                    payment.Id
                }, Workflows = new List <string> {
                    createWorkflowResponse.Id
                }
            };

            ReflowResponse reflowResponse =
                await Retriable(async() => await DefaultApi.WorkflowsClient().Reflow(request));

            reflowResponse.ShouldNotBeNull();
            reflowResponse.HttpStatusCode.ShouldNotBeNull();
            reflowResponse.ResponseHeaders.ShouldNotBeNull();
        }