public async stt::Task SuggestKeywordThemeConstantsRequestObjectAsync() { moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict); SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest { QueryText = "query_text3b0c4d80", CountryCode = "country_code8debec55", LanguageCode = "language_code2f6c7160", }; SuggestKeywordThemeConstantsResponse expectedResponse = new SuggestKeywordThemeConstantsResponse { KeywordThemeConstants = { new gagvr::KeywordThemeConstant(), }, }; mockGrpcClient.Setup(x => x.SuggestKeywordThemeConstantsAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <SuggestKeywordThemeConstantsResponse>(stt::Task.FromResult(expectedResponse), null, null, null, null)); KeywordThemeConstantServiceClient client = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null); SuggestKeywordThemeConstantsResponse responseCallSettings = await client.SuggestKeywordThemeConstantsAsync(request, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None)); xunit::Assert.Same(expectedResponse, responseCallSettings); SuggestKeywordThemeConstantsResponse responseCancellationToken = await client.SuggestKeywordThemeConstantsAsync(request, st::CancellationToken.None); xunit::Assert.Same(expectedResponse, responseCancellationToken); mockGrpcClient.VerifyAll(); }
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(); }
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(); }
public void SuggestKeywordThemeConstantsRequestObject() { moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient> mockGrpcClient = new moq::Mock <KeywordThemeConstantService.KeywordThemeConstantServiceClient>(moq::MockBehavior.Strict); SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest { QueryText = "query_text3b0c4d80", CountryCode = "country_code8debec55", LanguageCode = "language_code2f6c7160", }; SuggestKeywordThemeConstantsResponse expectedResponse = new SuggestKeywordThemeConstantsResponse { KeywordThemeConstants = { new gagvr::KeywordThemeConstant(), }, }; mockGrpcClient.Setup(x => x.SuggestKeywordThemeConstants(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); KeywordThemeConstantServiceClient client = new KeywordThemeConstantServiceClientImpl(mockGrpcClient.Object, null); SuggestKeywordThemeConstantsResponse response = client.SuggestKeywordThemeConstants(request); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }