/// <summary>Snippet for GetCurrencyConstant</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCurrencyConstantResourceNames()
 {
     // Create client
     CurrencyConstantServiceClient currencyConstantServiceClient = CurrencyConstantServiceClient.Create();
     // Initialize request argument(s)
     CurrencyConstantName resourceName = CurrencyConstantName.FromCurrencyConstant("[CURRENCY_CONSTANT]");
     // Make the request
     CurrencyConstant response = currencyConstantServiceClient.GetCurrencyConstant(resourceName);
 }
        /// <summary>Snippet for GetCurrencyConstantAsync</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 GetCurrencyConstantResourceNamesAsync()
        {
            // Create client
            CurrencyConstantServiceClient currencyConstantServiceClient = await CurrencyConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            CurrencyConstantName resourceName = CurrencyConstantName.FromCode("[CODE]");
            // Make the request
            CurrencyConstant response = await currencyConstantServiceClient.GetCurrencyConstantAsync(resourceName);
        }
 /// <summary>Snippet for GetCurrencyConstant</summary>
 public void GetCurrencyConstantResourceNames()
 {
     // Snippet: GetCurrencyConstant(CurrencyConstantName, CallSettings)
     // Create client
     CurrencyConstantServiceClient currencyConstantServiceClient = CurrencyConstantServiceClient.Create();
     // Initialize request argument(s)
     CurrencyConstantName resourceName = CurrencyConstantName.FromCode("[CODE]");
     // Make the request
     CurrencyConstant response = currencyConstantServiceClient.GetCurrencyConstant(resourceName);
     // End snippet
 }
 /// <summary>Snippet for GetCurrencyConstant</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetCurrencyConstantRequestObject()
 {
     // Create client
     CurrencyConstantServiceClient currencyConstantServiceClient = CurrencyConstantServiceClient.Create();
     // Initialize request argument(s)
     GetCurrencyConstantRequest request = new GetCurrencyConstantRequest
     {
         ResourceNameAsCurrencyConstantName = CurrencyConstantName.FromCode("[CODE]"),
     };
     // Make the request
     CurrencyConstant response = currencyConstantServiceClient.GetCurrencyConstant(request);
 }
        /// <summary>Snippet for GetCurrencyConstantAsync</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 GetCurrencyConstantRequestObjectAsync()
        {
            // Create client
            CurrencyConstantServiceClient currencyConstantServiceClient = await CurrencyConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCurrencyConstantRequest request = new GetCurrencyConstantRequest
            {
                ResourceNameAsCurrencyConstantName = CurrencyConstantName.FromCurrencyConstant("[CURRENCY_CONSTANT]"),
            };
            // Make the request
            CurrencyConstant response = await currencyConstantServiceClient.GetCurrencyConstantAsync(request);
        }
        /// <summary>Snippet for GetCurrencyConstantAsync</summary>
        public async Task GetCurrencyConstantResourceNamesAsync()
        {
            // Snippet: GetCurrencyConstantAsync(CurrencyConstantName, CallSettings)
            // Additional: GetCurrencyConstantAsync(CurrencyConstantName, CancellationToken)
            // Create client
            CurrencyConstantServiceClient currencyConstantServiceClient = await CurrencyConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            CurrencyConstantName resourceName = CurrencyConstantName.FromCode("[CODE]");
            // Make the request
            CurrencyConstant response = await currencyConstantServiceClient.GetCurrencyConstantAsync(resourceName);

            // End snippet
        }
Пример #7
0
 /// <summary>Snippet for GetCurrencyConstant</summary>
 public void GetCurrencyConstantRequestObject()
 {
     // Snippet: GetCurrencyConstant(GetCurrencyConstantRequest, CallSettings)
     // Create client
     CurrencyConstantServiceClient currencyConstantServiceClient = CurrencyConstantServiceClient.Create();
     // Initialize request argument(s)
     GetCurrencyConstantRequest request = new GetCurrencyConstantRequest
     {
         ResourceNameAsCurrencyConstantName = CurrencyConstantName.FromCurrencyConstant("[CURRENCY_CONSTANT]"),
     };
     // Make the request
     CurrencyConstant response = currencyConstantServiceClient.GetCurrencyConstant(request);
     // End snippet
 }
Пример #8
0
        /// <summary>Snippet for GetCurrencyConstantAsync</summary>
        public async Task GetCurrencyConstantRequestObjectAsync()
        {
            // Snippet: GetCurrencyConstantAsync(GetCurrencyConstantRequest, CallSettings)
            // Additional: GetCurrencyConstantAsync(GetCurrencyConstantRequest, CancellationToken)
            // Create client
            CurrencyConstantServiceClient currencyConstantServiceClient = await CurrencyConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetCurrencyConstantRequest request = new GetCurrencyConstantRequest
            {
                ResourceNameAsCurrencyConstantName = CurrencyConstantName.FromCurrencyConstant("[CURRENCY_CONSTANT]"),
            };
            // Make the request
            CurrencyConstant response = await currencyConstantServiceClient.GetCurrencyConstantAsync(request);

            // End snippet
        }
        public async Task GetCurrencyConstantAsync()
        {
            Mock <CurrencyConstantService.CurrencyConstantServiceClient> mockGrpcClient = new Mock <CurrencyConstantService.CurrencyConstantServiceClient>(MockBehavior.Strict);
            GetCurrencyConstantRequest expectedRequest = new GetCurrencyConstantRequest
            {
                ResourceName = new CurrencyConstantName("[CURRENCY_CONSTANT]").ToString(),
            };
            CurrencyConstant expectedResponse = new CurrencyConstant
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetCurrencyConstantAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <CurrencyConstant>(Task.FromResult(expectedResponse), null, null, null, null));
            CurrencyConstantServiceClient client   = new CurrencyConstantServiceClientImpl(mockGrpcClient.Object, null);
            string           formattedResourceName = new CurrencyConstantName("[CURRENCY_CONSTANT]").ToString();
            CurrencyConstant response = await client.GetCurrencyConstantAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }