示例#1
0
        public async Task ShouldReceiveResponseAsExpected()
        {
            // given
            var expectedResponse = new SetVariablesResponse
            {
                Key = 12
            };

            TestService.AddRequestHandler(typeof(SetVariablesRequest), request => expectedResponse);

            // when
            var response = await ZeebeClient.NewSetVariablesCommand(2123).Variables("{\"foo\":\"bar\"}").Local().Send();

            // then
            Assert.AreEqual(12, response.Key);
        }
示例#2
0
        public async Task ShouldSendRequestAsExpected()
        {
            // given
            var expectedRequest = new SetVariablesRequest
            {
                ElementInstanceKey = 2123,
                Variables          = "{\"foo\":\"bar\"}"
            };

            // when
            await ZeebeClient.NewSetVariablesCommand(2123).Variables("{\"foo\":\"bar\"}").Send();

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

            Assert.AreEqual(expectedRequest, request);
        }