コード例 #1
0
        public void ShouldCancelRequest()
        {
            // given

            // when
            var task = ZeebeClient
                       .NewUpdateRetriesCommand(1024)
                       .Retries(223)
                       .Send(new CancellationTokenSource(TimeSpan.Zero).Token);
            var aggregateException = Assert.Throws <AggregateException>(() => task.Wait());
            var rpcException       = (RpcException)aggregateException.InnerExceptions[0];

            // then
            Assert.AreEqual(StatusCode.Cancelled, rpcException.Status.StatusCode);
        }
コード例 #2
0
        public void ShouldTimeoutRequest()
        {
            // given

            // when
            var task = ZeebeClient
                       .NewUpdateRetriesCommand(1024)
                       .Retries(223)
                       .Send(TimeSpan.Zero);
            var aggregateException = Assert.Throws <AggregateException>(() => task.Wait());
            var rpcException       = (RpcException)aggregateException.InnerExceptions[0];

            // then
            Assert.AreEqual(StatusCode.DeadlineExceeded, rpcException.Status.StatusCode);
        }
コード例 #3
0
        public async Task shouldSendRequestAsExpected()
        {
            // given
            var expectedRequest = new UpdateJobRetriesRequest
            {
                JobKey  = 1024,
                Retries = 223
            };

            // when
            await ZeebeClient
            .NewUpdateRetriesCommand(1024)
            .Retries(223)
            .Send();

            // then
            var request = TestService.Requests[0];

            Assert.AreEqual(expectedRequest, request);
        }