/// <summary>Snippet for CheckActiveJobs</summary> public void CheckActiveJobsRequestObject() { // Snippet: CheckActiveJobs(CheckActiveJobsRequest, CallSettings) // Create client JobsV1Beta3Client jobsV1Beta3Client = JobsV1Beta3Client.Create(); // Initialize request argument(s) CheckActiveJobsRequest request = new CheckActiveJobsRequest { ProjectId = "", }; // Make the request CheckActiveJobsResponse response = jobsV1Beta3Client.CheckActiveJobs(request); // End snippet }
/// <summary>Snippet for CheckActiveJobsAsync</summary> public async Task CheckActiveJobsRequestObjectAsync() { // Snippet: CheckActiveJobsAsync(CheckActiveJobsRequest, CallSettings) // Additional: CheckActiveJobsAsync(CheckActiveJobsRequest, CancellationToken) // Create client JobsV1Beta3Client jobsV1Beta3Client = await JobsV1Beta3Client.CreateAsync(); // Initialize request argument(s) CheckActiveJobsRequest request = new CheckActiveJobsRequest { ProjectId = "", }; // Make the request CheckActiveJobsResponse response = await jobsV1Beta3Client.CheckActiveJobsAsync(request); // End snippet }
public void CheckActiveJobsRequestObject() { moq::Mock <JobsV1Beta3.JobsV1Beta3Client> mockGrpcClient = new moq::Mock <JobsV1Beta3.JobsV1Beta3Client>(moq::MockBehavior.Strict); CheckActiveJobsRequest request = new CheckActiveJobsRequest { ProjectId = "project_id43ad98b0", }; CheckActiveJobsResponse expectedResponse = new CheckActiveJobsResponse { ActiveJobsExist = false, }; mockGrpcClient.Setup(x => x.CheckActiveJobs(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); JobsV1Beta3Client client = new JobsV1Beta3ClientImpl(mockGrpcClient.Object, null); CheckActiveJobsResponse response = client.CheckActiveJobs(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async stt::Task CheckActiveJobsRequestObjectAsync() { moq::Mock <JobsV1Beta3.JobsV1Beta3Client> mockGrpcClient = new moq::Mock <JobsV1Beta3.JobsV1Beta3Client>(moq::MockBehavior.Strict); CheckActiveJobsRequest request = new CheckActiveJobsRequest { ProjectId = "project_id43ad98b0", }; CheckActiveJobsResponse expectedResponse = new CheckActiveJobsResponse { ActiveJobsExist = false, }; mockGrpcClient.Setup(x => x.CheckActiveJobsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <CheckActiveJobsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); JobsV1Beta3Client client = new JobsV1Beta3ClientImpl(mockGrpcClient.Object, null); CheckActiveJobsResponse responseCallSettings = await client.CheckActiveJobsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); CheckActiveJobsResponse responseCancellationToken = await client.CheckActiveJobsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }