/// <summary>Snippet for GetHotelPerformanceViewAsync</summary> public async Task GetHotelPerformanceViewResourceNamesAsync() { // Snippet: GetHotelPerformanceViewAsync(HotelPerformanceViewName, CallSettings) // Additional: GetHotelPerformanceViewAsync(HotelPerformanceViewName, CancellationToken) // Create client HotelPerformanceViewServiceClient hotelPerformanceViewServiceClient = await HotelPerformanceViewServiceClient.CreateAsync(); // Initialize request argument(s) HotelPerformanceViewName resourceName = HotelPerformanceViewName.FromCustomer("[CUSTOMER_ID]"); // Make the request HotelPerformanceView response = await hotelPerformanceViewServiceClient.GetHotelPerformanceViewAsync(resourceName); // End snippet }
/// <summary>Snippet for GetHotelPerformanceViewAsync</summary> public async Task GetHotelPerformanceViewAsync() { // Snippet: GetHotelPerformanceViewAsync(string, CallSettings) // Additional: GetHotelPerformanceViewAsync(string, CancellationToken) // Create client HotelPerformanceViewServiceClient hotelPerformanceViewServiceClient = await HotelPerformanceViewServiceClient.CreateAsync(); // Initialize request argument(s) string resourceName = "customers/[CUSTOMER_ID]/hotelPerformanceView"; // Make the request HotelPerformanceView response = await hotelPerformanceViewServiceClient.GetHotelPerformanceViewAsync(resourceName); // End snippet }
/// <summary>Snippet for GetHotelPerformanceView</summary> public void GetHotelPerformanceViewRequestObject() { // Snippet: GetHotelPerformanceView(GetHotelPerformanceViewRequest, CallSettings) // Create client HotelPerformanceViewServiceClient hotelPerformanceViewServiceClient = HotelPerformanceViewServiceClient.Create(); // Initialize request argument(s) GetHotelPerformanceViewRequest request = new GetHotelPerformanceViewRequest { ResourceNameAsHotelPerformanceViewName = HotelPerformanceViewName.FromCustomer("[CUSTOMER_ID]"), }; // Make the request HotelPerformanceView response = hotelPerformanceViewServiceClient.GetHotelPerformanceView(request); // End snippet }
public void GetHotelPerformanceView2() { Mock <HotelPerformanceViewService.HotelPerformanceViewServiceClient> mockGrpcClient = new Mock <HotelPerformanceViewService.HotelPerformanceViewServiceClient>(MockBehavior.Strict); GetHotelPerformanceViewRequest request = new GetHotelPerformanceViewRequest { ResourceName = new HotelPerformanceViewName("[CUSTOMER]").ToString(), }; HotelPerformanceView expectedResponse = new HotelPerformanceView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetHotelPerformanceView(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); HotelPerformanceViewServiceClient client = new HotelPerformanceViewServiceClientImpl(mockGrpcClient.Object, null); HotelPerformanceView response = client.GetHotelPerformanceView(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public async Task GetHotelPerformanceViewAsync2() { Mock <HotelPerformanceViewService.HotelPerformanceViewServiceClient> mockGrpcClient = new Mock <HotelPerformanceViewService.HotelPerformanceViewServiceClient>(MockBehavior.Strict); GetHotelPerformanceViewRequest request = new GetHotelPerformanceViewRequest { ResourceName = new HotelPerformanceViewName("[CUSTOMER]").ToString(), }; HotelPerformanceView expectedResponse = new HotelPerformanceView { ResourceName = "resourceName2625949903", }; mockGrpcClient.Setup(x => x.GetHotelPerformanceViewAsync(request, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <HotelPerformanceView>(Task.FromResult(expectedResponse), null, null, null, null)); HotelPerformanceViewServiceClient client = new HotelPerformanceViewServiceClientImpl(mockGrpcClient.Object, null); HotelPerformanceView response = await client.GetHotelPerformanceViewAsync(request); Assert.AreEqual(expectedResponse, response); mockGrpcClient.VerifyAll(); }