public async Task ShouldSendRequestWithFetchVariablesAsList()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceWithResultRequest
            {
                Request = new CreateWorkflowInstanceRequest
                {
                    BpmnProcessId = "process",
                    Version       = -1,
                    Variables     = "{\"foo\":1}"
                },
                FetchVariables = { "foo", "bar" }
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .BpmnProcessId("process")
            .LatestVersion()
            .Variables("{\"foo\":1}")
            .WithResult()
            .FetchVariables(new List <string> {
                "foo", "bar"
            })
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceWithResultRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
        public async Task ShouldSendRequestWithVersionAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceWithResultRequest
            {
                Request = new CreateWorkflowInstanceRequest
                {
                    BpmnProcessId = "process",
                    Version       = 1
                },
                RequestTimeout = 20 * 1000
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .BpmnProcessId("process")
            .Version(1)
            .WithResult()
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceWithResultRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
        public async Task ShouldSendRequestWithVariablesAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceWithResultRequest
            {
                Request = new CreateWorkflowInstanceRequest
                {
                    WorkflowKey = 1,
                    Variables   = "{\"foo\":1}"
                },
                RequestTimeout = 20 * 1000
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .WorkflowKey(1)
            .Variables("{\"foo\":1}")
            .WithResult()
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceWithResultRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
 public CreateWorkflowInstanceCommandWithResult(Gateway.GatewayClient client, CreateWorkflowInstanceRequest createRequest)
 {
     this.client             = client;
     createWithResultRequest = new CreateWorkflowInstanceWithResultRequest {
         Request = createRequest
     };
 }
        public async Task ShouldSendRequestWithWorkflowKeyAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceWithResultRequest
            {
                Request = new CreateWorkflowInstanceRequest
                {
                    WorkflowKey = 1
                }
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .WorkflowKey(1)
            .WithResult()
            .Send();

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceWithResultRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
        public async Task ShouldSendRequestWithRequestTimeoutAsExpected()
        {
            // given
            var expectedRequest = new CreateWorkflowInstanceWithResultRequest
            {
                Request = new CreateWorkflowInstanceRequest
                {
                    WorkflowKey = 1
                },
                RequestTimeout = 123 * 1000
            };

            // when
            await ZeebeClient.NewCreateWorkflowInstanceCommand()
            .WorkflowKey(1)
            .WithResult()
            .Send(TimeSpan.FromSeconds(123));

            // then
            var request = TestService.Requests[typeof(CreateWorkflowInstanceWithResultRequest)][0];

            Assert.AreEqual(expectedRequest, request);
        }
コード例 #7
0
 public override Task <CreateWorkflowInstanceWithResultResponse> CreateWorkflowInstanceWithResult(CreateWorkflowInstanceWithResultRequest request, ServerCallContext context)
 {
     return(Task.FromResult((CreateWorkflowInstanceWithResultResponse)HandleRequest(request, context)));
 }