public void GetCustomerManagerLink2() { Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceName = new CustomerManagerLinkName("[CUSTOMER]", "[CUSTOMER_MANAGER_LINK]").ToString(), }; CustomerManagerLink expectedResponse = new CustomerManagerLink { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetCustomerManagerLink(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); CustomerManagerLink response = client.GetCustomerManagerLink(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetCustomerManagerLink() { moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient> mockGrpcClient = new moq::Mock <CustomerManagerLinkService.CustomerManagerLinkServiceClient>(moq::MockBehavior.Strict); GetCustomerManagerLinkRequest request = new GetCustomerManagerLinkRequest { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), }; gagvr::CustomerManagerLink expectedResponse = new gagvr::CustomerManagerLink { ResourceNameAsCustomerManagerLinkName = gagvr::CustomerManagerLinkName.FromCustomerManagerCustomerManagerLink("[CUSTOMER_ID]", "[MANAGER_CUSTOMER_ID]", "[MANAGER_LINK_ID]"), Status = gagve::ManagerLinkStatusEnum.Types.ManagerLinkStatus.Inactive, ManagerCustomer = "manager_customer3075601e", ManagerLinkId = 1955158851327798968L, }; mockGrpcClient.Setup(x => x.GetCustomerManagerLink(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); CustomerManagerLinkServiceClient client = new CustomerManagerLinkServiceClientImpl(mockGrpcClient.Object, null); gagvr::CustomerManagerLink response = client.GetCustomerManagerLink(request.ResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }