コード例 #1
0
        public async stt::Task ListActiveBreakpointsRequestObjectAsync()
        {
            moq::Mock <Controller2.Controller2Client> mockGrpcClient = new moq::Mock <Controller2.Controller2Client>(moq::MockBehavior.Strict);
            ListActiveBreakpointsRequest request = new ListActiveBreakpointsRequest
            {
                DebuggeeId       = "debuggee_id454a924a",
                WaitToken        = "wait_tokencb600154",
                SuccessOnTimeout = false,
            };
            ListActiveBreakpointsResponse expectedResponse = new ListActiveBreakpointsResponse
            {
                Breakpoints   = { new Breakpoint(), },
                NextWaitToken = "next_wait_token2855eb7e",
                WaitExpired   = false,
            };

            mockGrpcClient.Setup(x => x.ListActiveBreakpointsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListActiveBreakpointsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            Controller2Client             client = new Controller2ClientImpl(mockGrpcClient.Object, null);
            ListActiveBreakpointsResponse responseCallSettings = await client.ListActiveBreakpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            ListActiveBreakpointsResponse responseCancellationToken = await client.ListActiveBreakpointsAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
コード例 #2
0
 /// <summary>Snippet for ListActiveBreakpoints</summary>
 public void ListActiveBreakpoints()
 {
     // Snippet: ListActiveBreakpoints(string, CallSettings)
     // Create client
     Controller2Client controller2Client = Controller2Client.Create();
     // Initialize request argument(s)
     string debuggeeId = "";
     // Make the request
     ListActiveBreakpointsResponse response = controller2Client.ListActiveBreakpoints(debuggeeId);
     // End snippet
 }
コード例 #3
0
        /// <summary>Snippet for ListActiveBreakpointsAsync</summary>
        public async Task ListActiveBreakpointsAsync()
        {
            // Snippet: ListActiveBreakpointsAsync(string, CallSettings)
            // Additional: ListActiveBreakpointsAsync(string, CancellationToken)
            // Create client
            Controller2Client controller2Client = await Controller2Client.CreateAsync();

            // Initialize request argument(s)
            string debuggeeId = "";
            // Make the request
            ListActiveBreakpointsResponse response = await controller2Client.ListActiveBreakpointsAsync(debuggeeId);

            // End snippet
        }
コード例 #4
0
 /// <summary>Snippet for ListActiveBreakpoints</summary>
 public void ListActiveBreakpoints_RequestObject()
 {
     // Snippet: ListActiveBreakpoints(ListActiveBreakpointsRequest,CallSettings)
     // Create client
     Controller2Client controller2Client = Controller2Client.Create();
     // Initialize request argument(s)
     ListActiveBreakpointsRequest request = new ListActiveBreakpointsRequest
     {
         DebuggeeId = "",
     };
     // Make the request
     ListActiveBreakpointsResponse response = controller2Client.ListActiveBreakpoints(request);
     // End snippet
 }
コード例 #5
0
        public void ListBreakpoints_WaitTimeout()
        {
            var bpReq  = CreateBreakpointRequest();
            var bpResp = new ListActiveBreakpointsResponse
            {
                NextWaitToken = _waitToken,
                WaitExpired   = true,
            };

            _mockControllerClient.Setup(c => c.RegisterDebuggee(It.IsAny <Debuggee>(), null)).Returns(_response);
            _mockControllerClient.Setup(c => c.ListActiveBreakpoints(bpReq, null)).Returns(bpResp);

            _client.Register();
            Assert.Null(_client.ListBreakpoints());
            _mockControllerClient.VerifyAll();
        }
コード例 #6
0
        /// <summary>Snippet for ListActiveBreakpointsAsync</summary>
        public async Task ListActiveBreakpointsAsync_RequestObject()
        {
            // Snippet: ListActiveBreakpointsAsync(ListActiveBreakpointsRequest,CallSettings)
            // Create client
            Controller2Client controller2Client = await Controller2Client.CreateAsync();

            // Initialize request argument(s)
            ListActiveBreakpointsRequest request = new ListActiveBreakpointsRequest
            {
                DebuggeeId = "",
            };
            // Make the request
            ListActiveBreakpointsResponse response = await controller2Client.ListActiveBreakpointsAsync(request);

            // End snippet
        }
コード例 #7
0
        /// <summary>Snippet for ListActiveBreakpointsAsync</summary>
        public async Task ListActiveBreakpointsAsync_RequestObject()
        {
            // Snippet: ListActiveBreakpointsAsync(ListActiveBreakpointsRequest, CallSettings)
            // Additional: ListActiveBreakpointsAsync(ListActiveBreakpointsRequest, CancellationToken)
            // Create client
            Controller2Client controller2Client = await Controller2Client.CreateAsync();

            // Initialize request argument(s)
            ListActiveBreakpointsRequest request = new ListActiveBreakpointsRequest
            {
                DebuggeeId       = "",
                WaitToken        = "",
                SuccessOnTimeout = false,
            };
            // Make the request
            ListActiveBreakpointsResponse response = await controller2Client.ListActiveBreakpointsAsync(request);

            // End snippet
        }
コード例 #8
0
        public async Task ListActiveBreakpointsAsync2()
        {
            Mock <Controller2.Controller2Client> mockGrpcClient = new Mock <Controller2.Controller2Client>(MockBehavior.Strict);
            ListActiveBreakpointsRequest         request        = new ListActiveBreakpointsRequest
            {
                DebuggeeId = "debuggeeId-997255898",
            };
            ListActiveBreakpointsResponse expectedResponse = new ListActiveBreakpointsResponse
            {
                NextWaitToken = "nextWaitToken1006864251",
                WaitExpired   = false,
            };

            mockGrpcClient.Setup(x => x.ListActiveBreakpointsAsync(request, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <ListActiveBreakpointsResponse>(Task.FromResult(expectedResponse), null, null, null, null));
            Controller2Client             client   = new Controller2ClientImpl(mockGrpcClient.Object, null);
            ListActiveBreakpointsResponse response = await client.ListActiveBreakpointsAsync(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #9
0
        public void ListActiveBreakpoints2()
        {
            Mock <Controller2.Controller2Client> mockGrpcClient = new Mock <Controller2.Controller2Client>(MockBehavior.Strict);
            ListActiveBreakpointsRequest         request        = new ListActiveBreakpointsRequest
            {
                DebuggeeId = "debuggeeId-997255898",
            };
            ListActiveBreakpointsResponse expectedResponse = new ListActiveBreakpointsResponse
            {
                NextWaitToken = "nextWaitToken1006864251",
                WaitExpired   = false,
            };

            mockGrpcClient.Setup(x => x.ListActiveBreakpoints(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            Controller2Client             client   = new Controller2ClientImpl(mockGrpcClient.Object, null);
            ListActiveBreakpointsResponse response = client.ListActiveBreakpoints(request);

            Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
コード例 #10
0
        public void ListActiveBreakpoints()
        {
            moq::Mock <Controller2.Controller2Client> mockGrpcClient = new moq::Mock <Controller2.Controller2Client>(moq::MockBehavior.Strict);
            ListActiveBreakpointsRequest request = new ListActiveBreakpointsRequest
            {
                DebuggeeId = "debuggee_id454a924a",
            };
            ListActiveBreakpointsResponse expectedResponse = new ListActiveBreakpointsResponse
            {
                Breakpoints   = { new Breakpoint(), },
                NextWaitToken = "next_wait_token2855eb7e",
                WaitExpired   = false,
            };

            mockGrpcClient.Setup(x => x.ListActiveBreakpoints(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            Controller2Client             client   = new Controller2ClientImpl(mockGrpcClient.Object, null);
            ListActiveBreakpointsResponse response = client.ListActiveBreakpoints(request.DebuggeeId);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }