public async stt::Task ListBreakpointsRequestObjectAsync() { moq::Mock <Debugger2.Debugger2Client> mockGrpcClient = new moq::Mock <Debugger2.Debugger2Client>(moq::MockBehavior.Strict); ListBreakpointsRequest request = new ListBreakpointsRequest { DebuggeeId = "debuggee_id454a924a", IncludeAllUsers = false, IncludeInactive = true, Action = new ListBreakpointsRequest.Types.BreakpointActionValue(), #pragma warning disable CS0612 StripResults = false, #pragma warning restore CS0612 WaitToken = "wait_tokencb600154", ClientVersion = "client_version92be8ead", }; ListBreakpointsResponse expectedResponse = new ListBreakpointsResponse { Breakpoints = { new Breakpoint(), }, NextWaitToken = "next_wait_token2855eb7e", }; mockGrpcClient.Setup(x => x.ListBreakpointsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListBreakpointsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); Debugger2Client client = new Debugger2ClientImpl(mockGrpcClient.Object, null); ListBreakpointsResponse responseCallSettings = await client.ListBreakpointsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); ListBreakpointsResponse responseCancellationToken = await client.ListBreakpointsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async stt::Task ListBreakpointsAsync() { moq::Mock <Debugger2.Debugger2Client> mockGrpcClient = new moq::Mock <Debugger2.Debugger2Client>(moq::MockBehavior.Strict); ListBreakpointsRequest request = new ListBreakpointsRequest { DebuggeeId = "debuggee_id454a924a", ClientVersion = "client_version92be8ead", }; ListBreakpointsResponse expectedResponse = new ListBreakpointsResponse { Breakpoints = { new Breakpoint(), }, NextWaitToken = "next_wait_token2855eb7e", }; mockGrpcClient.Setup(x => x.ListBreakpointsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <ListBreakpointsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); Debugger2Client client = new Debugger2ClientImpl(mockGrpcClient.Object, null); ListBreakpointsResponse responseCallSettings = await client.ListBreakpointsAsync(request.DebuggeeId, request.ClientVersion, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); ListBreakpointsResponse responseCancellationToken = await client.ListBreakpointsAsync(request.DebuggeeId, request.ClientVersion, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
public async Task ListBreakpointsAsync2() { Mock <Debugger2.Debugger2Client> mockGrpcClient = new Mock <Debugger2.Debugger2Client>(MockBehavior.Strict); ListBreakpointsRequest request = new ListBreakpointsRequest { DebuggeeId = "debuggeeId-997255898", ClientVersion = "clientVersion-1506231196", }; ListBreakpointsResponse expectedResponse = new ListBreakpointsResponse { NextWaitToken = "nextWaitToken1006864251", }; mockGrpcClient.Setup(x => x.ListBreakpointsAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <ListBreakpointsResponse>(Task.FromResult(expectedResponse), null, null, null, null)); Debugger2Client client = new Debugger2ClientImpl(mockGrpcClient.Object, null); ListBreakpointsResponse response = await client.ListBreakpointsAsync(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }