/// <summary>Snippet for GetShoppingPerformanceView</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetShoppingPerformanceViewResourceNames() { // Create client ShoppingPerformanceViewServiceClient shoppingPerformanceViewServiceClient = ShoppingPerformanceViewServiceClient.Create(); // Initialize request argument(s) ShoppingPerformanceViewName resourceName = ShoppingPerformanceViewName.FromCustomer("[CUSTOMER]"); // Make the request ShoppingPerformanceView response = shoppingPerformanceViewServiceClient.GetShoppingPerformanceView(resourceName); }
/// <summary>Snippet for GetShoppingPerformanceViewAsync</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public async Task GetShoppingPerformanceViewResourceNamesAsync() { // Create client ShoppingPerformanceViewServiceClient shoppingPerformanceViewServiceClient = await ShoppingPerformanceViewServiceClient.CreateAsync(); // Initialize request argument(s) ShoppingPerformanceViewName resourceName = ShoppingPerformanceViewName.FromCustomer("[CUSTOMER]"); // Make the request ShoppingPerformanceView response = await shoppingPerformanceViewServiceClient.GetShoppingPerformanceViewAsync(resourceName); }
/// <summary>Snippet for GetShoppingPerformanceView</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetShoppingPerformanceViewRequestObject() { // Create client ShoppingPerformanceViewServiceClient shoppingPerformanceViewServiceClient = ShoppingPerformanceViewServiceClient.Create(); // Initialize request argument(s) GetShoppingPerformanceViewRequest request = new GetShoppingPerformanceViewRequest { ResourceNameAsShoppingPerformanceViewName = ShoppingPerformanceViewName.FromCustomer("[CUSTOMER_ID]"), }; // Make the request ShoppingPerformanceView response = shoppingPerformanceViewServiceClient.GetShoppingPerformanceView(request); }
/// <summary>Snippet for GetShoppingPerformanceViewAsync</summary> public async Task GetShoppingPerformanceViewResourceNamesAsync() { // Snippet: GetShoppingPerformanceViewAsync(ShoppingPerformanceViewName, CallSettings) // Additional: GetShoppingPerformanceViewAsync(ShoppingPerformanceViewName, CancellationToken) // Create client ShoppingPerformanceViewServiceClient shoppingPerformanceViewServiceClient = await ShoppingPerformanceViewServiceClient.CreateAsync(); // Initialize request argument(s) ShoppingPerformanceViewName resourceName = ShoppingPerformanceViewName.FromCustomer("[CUSTOMER]"); // Make the request ShoppingPerformanceView response = await shoppingPerformanceViewServiceClient.GetShoppingPerformanceViewAsync(resourceName); // End snippet }
public async Task GetShoppingPerformanceViewAsync() { Mock <ShoppingPerformanceViewService.ShoppingPerformanceViewServiceClient> mockGrpcClient = new Mock <ShoppingPerformanceViewService.ShoppingPerformanceViewServiceClient>(MockBehavior.Strict); GetShoppingPerformanceViewRequest expectedRequest = new GetShoppingPerformanceViewRequest { ResourceName = new ShoppingPerformanceViewName("[CUSTOMER]").ToString(), }; ShoppingPerformanceView expectedResponse = new ShoppingPerformanceView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetShoppingPerformanceViewAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <ShoppingPerformanceView>(Task.FromResult(expectedResponse), null, null, null, null)); ShoppingPerformanceViewServiceClient client = new ShoppingPerformanceViewServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new ShoppingPerformanceViewName("[CUSTOMER]").ToString(); ShoppingPerformanceView response = await client.GetShoppingPerformanceViewAsync(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetShoppingPerformanceView() { Mock <ShoppingPerformanceViewService.ShoppingPerformanceViewServiceClient> mockGrpcClient = new Mock <ShoppingPerformanceViewService.ShoppingPerformanceViewServiceClient>(MockBehavior.Strict); GetShoppingPerformanceViewRequest expectedRequest = new GetShoppingPerformanceViewRequest { ResourceName = new ShoppingPerformanceViewName("[CUSTOMER]").ToString(), }; ShoppingPerformanceView expectedResponse = new ShoppingPerformanceView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetShoppingPerformanceView(expectedRequest, It.IsAny <CallOptions>())) .Returns(expectedResponse); ShoppingPerformanceViewServiceClient client = new ShoppingPerformanceViewServiceClientImpl(mockGrpcClient.Object, null); string formattedResourceName = new ShoppingPerformanceViewName("[CUSTOMER]").ToString(); ShoppingPerformanceView response = client.GetShoppingPerformanceView(formattedResourceName); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }