Пример #1
0
        public void DeleteJob2()
        {
            Mock <JobController.JobControllerClient> mockGrpcClient = new Mock <JobController.JobControllerClient>(MockBehavior.Strict);
            DeleteJobRequest request = new DeleteJobRequest
            {
                ProjectId = "projectId-1969970175",
                Region    = "region-934795532",
                JobId     = "jobId-1154752291",
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteJob(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            JobControllerClient client = new JobControllerClientImpl(mockGrpcClient.Object, null);

            client.DeleteJob(request);
            mockGrpcClient.VerifyAll();
        }
Пример #2
0
        public void DeleteJob()
        {
            moq::Mock <JobController.JobControllerClient> mockGrpcClient = new moq::Mock <JobController.JobControllerClient>(moq::MockBehavior.Strict);
            DeleteJobRequest request = new DeleteJobRequest
            {
                ProjectId = "project_id43ad98b0",
                JobId     = "job_id38ea97d6",
                Region    = "regionedb20d96",
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteJob(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            JobControllerClient client = new JobControllerClientImpl(mockGrpcClient.Object, null);

            client.DeleteJob(request.ProjectId, request.Region, request.JobId);
            mockGrpcClient.VerifyAll();
        }