public void ListMerchantCenterLinks2() { Mock <MerchantCenterLinkService.MerchantCenterLinkServiceClient> mockGrpcClient = new Mock <MerchantCenterLinkService.MerchantCenterLinkServiceClient>(MockBehavior.Strict); ListMerchantCenterLinksRequest request = new ListMerchantCenterLinksRequest { CustomerId = "customerId-1772061412", }; ListMerchantCenterLinksResponse expectedResponse = new ListMerchantCenterLinksResponse(); mockGrpcClient.Setup(x => x.ListMerchantCenterLinks(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); MerchantCenterLinkServiceClient client = new MerchantCenterLinkServiceClientImpl(mockGrpcClient.Object, null); ListMerchantCenterLinksResponse response = client.ListMerchantCenterLinks(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void ListMerchantCenterLinks() { moq::Mock<MerchantCenterLinkService.MerchantCenterLinkServiceClient> mockGrpcClient = new moq::Mock<MerchantCenterLinkService.MerchantCenterLinkServiceClient>(moq::MockBehavior.Strict); ListMerchantCenterLinksRequest request = new ListMerchantCenterLinksRequest { CustomerId = "customer_id3b3724cb", }; ListMerchantCenterLinksResponse expectedResponse = new ListMerchantCenterLinksResponse { MerchantCenterLinks = { new gagvr::MerchantCenterLink(), }, }; mockGrpcClient.Setup(x => x.ListMerchantCenterLinks(request, moq::It.IsAny<grpccore::CallOptions>())).Returns(expectedResponse); MerchantCenterLinkServiceClient client = new MerchantCenterLinkServiceClientImpl(mockGrpcClient.Object, null); ListMerchantCenterLinksResponse response = client.ListMerchantCenterLinks(request.CustomerId); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }