Пример #1
0
            public void SendsAndReceives()
            {
                IClient client = CreateClient();

                _runtime.ReadResponse().Returns(GetOkResponse(new CallbacksResponse(
                                                                  new[]
                {
                    new Callback
                    (
                        callbackId: "myCallbackId",
                        invoke: new InvokeRequest(
                            objectReference: new ObjectReference {
                        { "$jsii.byref", "myRef" }
                    },
                            method: "myMethod",
                            arguments: new object[] { "arg1", "arg2" }
                            )
                    )
                }
                                                                  )));

                CallbacksRequest request = new CallbacksRequest();

                client.Callbacks(request);

                _runtime.Received().WriteRequest(Arg.Is <string>(
                                                     actual => PlatformIndependentEqual(JsonConvert.SerializeObject(request), actual)
                                                     ));
                _runtime.Received().ReadResponse();
            }
Пример #2
0
 public CallbacksResponse Callbacks(CallbacksRequest request)
 {
     return(Send <CallbacksRequest, CallbacksResponse>(request));
 }