示例#1
0
        public void BatchDeleteJobs2()
        {
            Mock <JobService.JobServiceClient> mockGrpcClient = new Mock <JobService.JobServiceClient>(MockBehavior.Strict);
            BatchDeleteJobsRequest             request        = new BatchDeleteJobsRequest
            {
                ParentAsTenantOrProjectNameOneof = TenantOrProjectNameOneof.From(new TenantName("[PROJECT]", "[TENANT]")),
                Filter = "filter-1274492040",
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.BatchDeleteJobs(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            JobServiceClient client = new JobServiceClientImpl(mockGrpcClient.Object, null);

            client.BatchDeleteJobs(request);
            mockGrpcClient.VerifyAll();
        }
        public void BatchDeleteJobs()
        {
            Mock <JobService.JobServiceClient> mockGrpcClient  = new Mock <JobService.JobServiceClient>(MockBehavior.Strict);
            BatchDeleteJobsRequest             expectedRequest = new BatchDeleteJobsRequest
            {
                ParentAsProjectName = new ProjectName("[PROJECT]"),
                Filter = "filter-1274492040",
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.BatchDeleteJobs(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            JobServiceClient client = new JobServiceClientImpl(mockGrpcClient.Object, null);
            ProjectName      parent = new ProjectName("[PROJECT]");
            string           filter = "filter-1274492040";

            client.BatchDeleteJobs(parent, filter);
            mockGrpcClient.VerifyAll();
        }