Ejemplo n.º 1
0
        public void DeleteJob2()
        {
            Mock <JobService.JobServiceClient> mockGrpcClient = new Mock <JobService.JobServiceClient>(MockBehavior.Strict);
            DeleteJobRequest request = new DeleteJobRequest
            {
                JobNameOneof = JobNameOneof.From(new JobOldName("[PROJECT]", "[JOBS]")),
            };
            Empty expectedResponse = new Empty();

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

            client.DeleteJob(request);
            mockGrpcClient.VerifyAll();
        }
Ejemplo n.º 2
0
        public void DeleteJob()
        {
            Mock <JobService.JobServiceClient> mockGrpcClient = new Mock <JobService.JobServiceClient>(MockBehavior.Strict);
            DeleteJobRequest expectedRequest = new DeleteJobRequest
            {
                Name = new JobName("[PROJECT]", "[JOB]").ToString(),
            };
            Empty expectedResponse = new Empty();

            mockGrpcClient.Setup(x => x.DeleteJob(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            JobServiceClient client        = new JobServiceClientImpl(mockGrpcClient.Object, null);
            string           formattedName = new JobName("[PROJECT]", "[JOB]").ToString();

            client.DeleteJob(formattedName);
            mockGrpcClient.VerifyAll();
        }