示例#1
0
        public async stt::Task GetProductBiddingCategoryConstantRequestObjectAsync()
        {
            moq::Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient> mockGrpcClient = new moq::Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient>(moq::MockBehavior.Strict);
            GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
            {
                ResourceNameAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromProductBiddingCategoryConstant("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"),
            };
            gagvr::ProductBiddingCategoryConstant expectedResponse = new gagvr::ProductBiddingCategoryConstant
            {
                ResourceNameAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromProductBiddingCategoryConstant("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"),
                Id          = -6774108720365892680L,
                CountryCode = "country_code8debec55",
                ProductBiddingCategoryConstantParentAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromProductBiddingCategoryConstant("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"),
                Level         = gagve::ProductBiddingCategoryLevelEnum.Types.ProductBiddingCategoryLevel.Unknown,
                Status        = gagve::ProductBiddingCategoryStatusEnum.Types.ProductBiddingCategoryStatus.Active,
                LanguageCode  = "language_code2f6c7160",
                LocalizedName = "localized_namefc402dfa",
            };

            mockGrpcClient.Setup(x => x.GetProductBiddingCategoryConstantAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::ProductBiddingCategoryConstant>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ProductBiddingCategoryConstantServiceClient client = new ProductBiddingCategoryConstantServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::ProductBiddingCategoryConstant       responseCallSettings = await client.GetProductBiddingCategoryConstantAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            gagvr::ProductBiddingCategoryConstant responseCancellationToken = await client.GetProductBiddingCategoryConstantAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
        public void GetProductBiddingCategoryConstant()
        {
            moq::Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient> mockGrpcClient = new moq::Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient>(moq::MockBehavior.Strict);
            GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
            {
                ResourceNameAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromCountryCodeLevelId("[COUNTRY_CODE]", "[LEVEL]", "[ID]"),
            };
            gagvr::ProductBiddingCategoryConstant expectedResponse = new gagvr::ProductBiddingCategoryConstant
            {
                ResourceNameAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromCountryCodeLevelId("[COUNTRY_CODE]", "[LEVEL]", "[ID]"),
                Level       = gagve::ProductBiddingCategoryLevelEnum.Types.ProductBiddingCategoryLevel.Unknown,
                Status      = gagve::ProductBiddingCategoryStatusEnum.Types.ProductBiddingCategoryStatus.Active,
                Id          = -6774108720365892680L,
                CountryCode = "country_code8debec55",
                ProductBiddingCategoryConstantParentAsProductBiddingCategoryConstantName = gagvr::ProductBiddingCategoryConstantName.FromCountryCodeLevelId("[COUNTRY_CODE]", "[LEVEL]", "[ID]"),
                LanguageCode  = "language_code2f6c7160",
                LocalizedName = "localized_namefc402dfa",
            };

            mockGrpcClient.Setup(x => x.GetProductBiddingCategoryConstant(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ProductBiddingCategoryConstantServiceClient client   = new ProductBiddingCategoryConstantServiceClientImpl(mockGrpcClient.Object, null);
            gagvr::ProductBiddingCategoryConstant       response = client.GetProductBiddingCategoryConstant(request.ResourceName);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
示例#3
0
 /// <summary>Snippet for GetProductBiddingCategoryConstant</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetProductBiddingCategoryConstantRequestObject()
 {
     // Create client
     ProductBiddingCategoryConstantServiceClient productBiddingCategoryConstantServiceClient = ProductBiddingCategoryConstantServiceClient.Create();
     // Initialize request argument(s)
     GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
     {
         ResourceNameAsProductBiddingCategoryConstantName = ProductBiddingCategoryConstantName.FromCountryCodeLevelId("[COUNTRY_CODE]", "[LEVEL]", "[ID]"),
     };
     // Make the request
     ProductBiddingCategoryConstant response = productBiddingCategoryConstantServiceClient.GetProductBiddingCategoryConstant(request);
 }
 /// <summary>Snippet for GetProductBiddingCategoryConstant</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetProductBiddingCategoryConstantRequestObject()
 {
     // Create client
     ProductBiddingCategoryConstantServiceClient productBiddingCategoryConstantServiceClient = ProductBiddingCategoryConstantServiceClient.Create();
     // Initialize request argument(s)
     GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
     {
         ResourceNameAsProductBiddingCategoryConstantName = ProductBiddingCategoryConstantName.FromProductBiddingCategoryConstant("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"),
     };
     // Make the request
     ProductBiddingCategoryConstant response = productBiddingCategoryConstantServiceClient.GetProductBiddingCategoryConstant(request);
 }
示例#5
0
        /// <summary>Snippet for GetProductBiddingCategoryConstantAsync</summary>
        public async Task GetProductBiddingCategoryConstantRequestObjectAsync()
        {
            // Snippet: GetProductBiddingCategoryConstantAsync(GetProductBiddingCategoryConstantRequest, CallSettings)
            // Additional: GetProductBiddingCategoryConstantAsync(GetProductBiddingCategoryConstantRequest, CancellationToken)
            // Create client
            ProductBiddingCategoryConstantServiceClient productBiddingCategoryConstantServiceClient = await ProductBiddingCategoryConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
            {
                ResourceNameAsProductBiddingCategoryConstantName = ProductBiddingCategoryConstantName.FromProductBiddingCategoryConstant("[PRODUCT_BIDDING_CATEGORY_CONSTANT]"),
            };
            // Make the request
            ProductBiddingCategoryConstant response = await productBiddingCategoryConstantServiceClient.GetProductBiddingCategoryConstantAsync(request);

            // End snippet
        }
        /// <summary>Snippet for GetProductBiddingCategoryConstantAsync</summary>
        public async Task GetProductBiddingCategoryConstantRequestObjectAsync()
        {
            // Snippet: GetProductBiddingCategoryConstantAsync(GetProductBiddingCategoryConstantRequest, CallSettings)
            // Additional: GetProductBiddingCategoryConstantAsync(GetProductBiddingCategoryConstantRequest, CancellationToken)
            // Create client
            ProductBiddingCategoryConstantServiceClient productBiddingCategoryConstantServiceClient = await ProductBiddingCategoryConstantServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
            {
                ResourceNameAsProductBiddingCategoryConstantName = ProductBiddingCategoryConstantName.FromCountryCodeLevelId("[COUNTRY_CODE]", "[LEVEL]", "[ID]"),
            };
            // Make the request
            ProductBiddingCategoryConstant response = await productBiddingCategoryConstantServiceClient.GetProductBiddingCategoryConstantAsync(request);

            // End snippet
        }
        public void GetProductBiddingCategoryConstant2()
        {
            Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient> mockGrpcClient = new Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient>(MockBehavior.Strict);
            GetProductBiddingCategoryConstantRequest request = new GetProductBiddingCategoryConstantRequest
            {
                ResourceName = new ProductBiddingCategoryConstantName("[PRODUCT_BIDDING_CATEGORY_CONSTANT]").ToString(),
            };
            ProductBiddingCategoryConstant expectedResponse = new ProductBiddingCategoryConstant
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetProductBiddingCategoryConstant(request, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            ProductBiddingCategoryConstantServiceClient client = new ProductBiddingCategoryConstantServiceClientImpl(mockGrpcClient.Object, null);
            ProductBiddingCategoryConstant response            = client.GetProductBiddingCategoryConstant(request);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetProductBiddingCategoryConstantAsync()
        {
            Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient> mockGrpcClient = new Mock <ProductBiddingCategoryConstantService.ProductBiddingCategoryConstantServiceClient>(MockBehavior.Strict);
            GetProductBiddingCategoryConstantRequest expectedRequest = new GetProductBiddingCategoryConstantRequest
            {
                ResourceName = new ProductBiddingCategoryConstantName("[PRODUCT_BIDDING_CATEGORY_CONSTANT]").ToString(),
            };
            ProductBiddingCategoryConstant expectedResponse = new ProductBiddingCategoryConstant
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetProductBiddingCategoryConstantAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <ProductBiddingCategoryConstant>(Task.FromResult(expectedResponse), null, null, null, null));
            ProductBiddingCategoryConstantServiceClient client = new ProductBiddingCategoryConstantServiceClientImpl(mockGrpcClient.Object, null);
            string formattedResourceName            = new ProductBiddingCategoryConstantName("[PRODUCT_BIDDING_CATEGORY_CONSTANT]").ToString();
            ProductBiddingCategoryConstant response = await client.GetProductBiddingCategoryConstantAsync(formattedResourceName);

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