public void MoveManagerLink()
        {
            Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict);
            MoveManagerLinkRequest expectedRequest = new MoveManagerLinkRequest
            {
                CustomerId = "customerId-1772061412",
                PreviousCustomerManagerLink = "previousCustomerManagerLink-1454597947",
                NewManager = "newManager90619918",
            };
            MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse
            {
                ResourceName = "resourceName979421212",
            };

            mockGrpcClient.Setup(x => x.MoveManagerLink(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null);
            string customerId = "customerId-1772061412";
            string previousCustomerManagerLink = "previousCustomerManagerLink-1454597947";
            string newManager = "newManager90619918";
            MoveManagerLinkResponse response = client.MoveManagerLink(customerId, previousCustomerManagerLink, newManager);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Exemple #2
0
        public void MoveManagerLink()
        {
            moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict);
            MoveManagerLinkRequest request = new MoveManagerLinkRequest
            {
                CustomerId = "customer_id3b3724cb",
                PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8",
                NewManager = "new_managerbf35b8c4",
            };
            MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse
            {
                ResourceName = "resource_name8cc2e687",
            };

            mockGrpcClient.Setup(x => x.MoveManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomerManagerLinkServiceClient client   = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null);
            MoveManagerLinkResponse          response = client.MoveManagerLink(request.CustomerId, request.PreviousCustomerManagerLink, request.NewManager);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public void MoveManagerLinkRequestObject()
        {
            moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict);
            MoveManagerLinkRequest request = new MoveManagerLinkRequest
            {
                CustomerId = "customer_id3b3724cb",
                PreviousCustomerManagerLink = "previous_customer_manager_linkb33a0aa8",
                NewManager   = "new_managerbf35b8c4",
                ValidateOnly = true,
            };
            MoveManagerLinkResponse expectedResponse = new MoveManagerLinkResponse
            {
                ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"),
            };

            mockGrpcClient.Setup(x => x.MoveManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CustomerManagerLinkServiceClient client   = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null);
            MoveManagerLinkResponse          response = client.MoveManagerLink(request);

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