public async stt::Task GetKeywordThemeConstantRequestObjectAsync() { moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict); GetKeywordThemeConstantRequest request = new GetKeywordThemeConstantRequest { ResourceNameAsKeywordThemeConstantName = gagvr::KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), }; gagvr::KeywordThemeConstant expectedResponse = new gagvr::KeywordThemeConstant { ResourceNameAsKeywordThemeConstantName = gagvr::KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), CountryCode = "country_code8debec55", LanguageCode = "language_code2f6c7160", DisplayName = "display_name137f65c2", }; mockGrpcClient.Setup(x => x.GetKeywordThemeConstantAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <gagvr::KeywordThemeConstant>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordThemeConstantServiceClient client = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null); gagvr::KeywordThemeConstant responseCallSettings = await client.GetKeywordThemeConstantAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); gagvr::KeywordThemeConstant responseCancellationToken = await client.GetKeywordThemeConstantAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
/// <summary>Snippet for GetKeywordThemeConstant</summary> /// <remarks> /// This snippet has been automatically generated for illustrative purposes only. /// It may require modifications to work in your environment. /// </remarks> public void GetKeywordThemeConstantRequestObject() { // Create client KeywordThemeConstantServiceClient keywordThemeConstantServiceClient = KeywordThemeConstantServiceClient.Create(); // Initialize request argument(s) GetKeywordThemeConstantRequest request = new GetKeywordThemeConstantRequest { ResourceNameAsKeywordThemeConstantName = KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), }; // Make the request KeywordThemeConstant response = keywordThemeConstantServiceClient.GetKeywordThemeConstant(request); }
/// <summary>Snippet for GetKeywordThemeConstantAsync</summary> public async Task GetKeywordThemeConstantRequestObjectAsync() { // Snippet: GetKeywordThemeConstantAsync(GetKeywordThemeConstantRequest, CallSettings) // Additional: GetKeywordThemeConstantAsync(GetKeywordThemeConstantRequest, CancellationToken) // Create client KeywordThemeConstantServiceClient keywordThemeConstantServiceClient = await KeywordThemeConstantServiceClient.CreateAsync(); // Initialize request argument(s) GetKeywordThemeConstantRequest request = new GetKeywordThemeConstantRequest { ResourceNameAsKeywordThemeConstantName = KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), }; // Make the request KeywordThemeConstant response = await keywordThemeConstantServiceClient.GetKeywordThemeConstantAsync(request); // End snippet }
public void GetKeywordThemeConstant() { moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict); GetKeywordThemeConstantRequest request = new GetKeywordThemeConstantRequest { ResourceNameAsKeywordThemeConstantName = gagvr::KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), }; gagvr::KeywordThemeConstant expectedResponse = new gagvr::KeywordThemeConstant { ResourceNameAsKeywordThemeConstantName = gagvr::KeywordThemeConstantName.FromExpressCategoryExpressSubCategory("[EXPRESS_CATEGORY_ID]", "[EXPRESS_SUB_CATEGORY_ID]"), CountryCode = "country_code8debec55", LanguageCode = "language_code2f6c7160", DisplayName = "display_name137f65c2", }; mockGrpcClient.Setup(x => x.GetKeywordThemeConstant(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordThemeConstantServiceClient client = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null); gagvr::KeywordThemeConstant response = client.GetKeywordThemeConstant(request.ResourceName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }