public void MutateCustomerManagerLink() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customer_id3b3724cb", Operations = { new CustomerManagerLinkOperation(), }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse { Results = { new MutateCustomerManagerLinkResult(), }, }; mockGrpcClient.Setup(x => x.MutateCustomerManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse response = client.MutateCustomerManagerLink(request.CustomerId, request.Operations); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void MutateCustomerManagerLink2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); MutateCustomerManagerLinkRequest request = new MutateCustomerManagerLinkRequest { CustomerId = "customerId-1772061412", Operations = { }, }; MutateCustomerManagerLinkResponse expectedResponse = new MutateCustomerManagerLinkResponse(); mockGrpcClient.Setup(x => x.MutateCustomerManagerLink(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); MutateCustomerManagerLinkResponse response = client.MutateCustomerManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }