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();
        }
Esempio n. 2
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();
        }