public void MutateCustomer3()
        {
            Mock <CustomerService.CustomerServiceClient> mockGrpcClient = new Mock <CustomerService.CustomerServiceClient>(MockBehavior.Strict);
            MutateCustomerRequest request = new MutateCustomerRequest
            {
                CustomerId = "customerId-1772061412",
                Operation  = new CustomerOperation(),
            };
            MutateCustomerResponse expectedResponse = new MutateCustomerResponse();

            mockGrpcClient.Setup(x => x.MutateCustomer(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomerServiceClient  client   = new CustomerServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomerResponse response = client.MutateCustomer(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MutateCustomer()
        {
            moq::Mock <CustomerService.CustomerServiceClient> mockGrpcClient = new moq::Mock <CustomerService.CustomerServiceClient>(moq::MockBehavior.Strict);
            MutateCustomerRequest request = new MutateCustomerRequest
            {
                CustomerId = "customer_id3b3724cb",
                Operation  = new CustomerOperation(),
            };
            MutateCustomerResponse expectedResponse = new MutateCustomerResponse
            {
                Result = new MutateCustomerResult(),
            };

            mockGrpcClient.Setup(x => x.MutateCustomer(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomerServiceClient  client   = new CustomerServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomerResponse response = client.MutateCustomer(request.CustomerId, request.Operation);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Esempio n. 3
0
        public void MutateCustomerRequestObject()
        {
            moq::Mock <CustomerService.CustomerServiceClient> mockGrpcClient = new moq::Mock <CustomerService.CustomerServiceClient>(moq::MockBehavior.Strict);
            MutateCustomerRequest request = new MutateCustomerRequest
            {
                CustomerId          = "customer_id3b3724cb",
                Operation           = new CustomerOperation(),
                ValidateOnly        = true,
                ResponseContentType = gagve::ResponseContentTypeEnum.Types.ResponseContentType.ResourceNameOnly,
            };
            MutateCustomerResponse expectedResponse = new MutateCustomerResponse
            {
                Result = new MutateCustomerResult(),
            };

            mockGrpcClient.Setup(x => x.MutateCustomer(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomerServiceClient  client   = new CustomerServiceClientImpl(mockGrpcClient.Object, null);
            MutateCustomerResponse response = client.MutateCustomer(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }