Beispiel #1
0
        public void CompleteQueryRequestObject()
        {
            moq::Mock <Completion.CompletionClient> mockGrpcClient = new moq::Mock <Completion.CompletionClient>(moq::MockBehavior.Strict);
            CompleteQueryRequest request = new CompleteQueryRequest
            {
                ParentAsTenantOrProjectName = TenantOrProjectName.FromProjectTenant("[PROJECT]", "[TENANT]"),
                Query         = "queryf0c71c1b",
                LanguageCodes =
                {
                    "language_codes1de1a181",
                },
                PageSize             = -226905851,
                CompanyAsCompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                Scope = CompleteQueryRequest.Types.CompletionScope.Unspecified,
                Type  = CompleteQueryRequest.Types.CompletionType.Combined,
            };
            CompleteQueryResponse expectedResponse = new CompleteQueryResponse
            {
                CompletionResults =
                {
                    new CompleteQueryResponse.Types.CompletionResult(),
                },
                Metadata = new ResponseMetadata(),
            };

            mockGrpcClient.Setup(x => x.CompleteQuery(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CompletionClient      client   = new CompletionClientImpl(mockGrpcClient.Object, null);
            CompleteQueryResponse response = client.CompleteQuery(request);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #2
0
        public async stt::Task CompleteQueryRequestObjectAsync()
        {
            moq::Mock <Completion.CompletionClient> mockGrpcClient = new moq::Mock <Completion.CompletionClient>(moq::MockBehavior.Strict);
            CompleteQueryRequest request = new CompleteQueryRequest
            {
                ParentAsTenantOrProjectName = TenantOrProjectName.FromProjectTenant("[PROJECT]", "[TENANT]"),
                Query         = "queryf0c71c1b",
                LanguageCodes =
                {
                    "language_codes1de1a181",
                },
                PageSize             = -226905851,
                CompanyAsCompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                Scope = CompleteQueryRequest.Types.CompletionScope.Unspecified,
                Type  = CompleteQueryRequest.Types.CompletionType.Combined,
            };
            CompleteQueryResponse expectedResponse = new CompleteQueryResponse
            {
                CompletionResults =
                {
                    new CompleteQueryResponse.Types.CompletionResult(),
                },
                Metadata = new ResponseMetadata(),
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            CompleteQueryResponse responseCancellationToken = await client.CompleteQueryAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #3
0
        public void UpdateCompany()
        {
            moq::Mock <CompanyService.CompanyServiceClient> mockGrpcClient = new moq::Mock <CompanyService.CompanyServiceClient>(moq::MockBehavior.Strict);
            UpdateCompanyRequest request = new UpdateCompanyRequest
            {
                Company = new Company(),
            };
            Company expectedResponse = new Company
            {
                CompanyName         = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                DisplayName         = "display_name137f65c2",
                ExternalId          = "external_id9442680e",
                Size                = CompanySize.Mini,
                HeadquartersAddress = "headquarters_address64cd7eb7",
                HiringAgency        = true,
                EeoText             = "eeo_text70a1a576",
                WebsiteUri          = "website_urid0c5dfce",
                CareerSiteUri       = "career_site_uri62d45b74",
                ImageUri            = "image_urieba3b1bc",
                KeywordSearchableJobCustomAttributes =
                {
                    "keyword_searchable_job_custom_attributese72ec77c",
                },
                DerivedInfo = new Company.Types.DerivedInfo(),
                Suspended   = true,
            };

            mockGrpcClient.Setup(x => x.UpdateCompany(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CompanyServiceClient client = new CompanyServiceClientImpl(mockGrpcClient.Object, null);
            Company response            = client.UpdateCompany(request.Company);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #4
0
        public void UpdateApplication()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            UpdateApplicationRequest request = new UpdateApplicationRequest
            {
                Application = new Application(),
            };
            Application expectedResponse = new Application
            {
                ApplicationName      = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
                Profile              = "profile1b48977d",
                JobAsJobName         = JobName.FromProjectJob("[PROJECT]", "[JOB]"),
                CompanyAsCompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                ApplicationDate      = new gt::Date(),
                Stage           = Application.Types.ApplicationStage.OfferAccepted,
                State           = Application.Types.ApplicationState.Unspecified,
                Interviews      = { new Interview(), },
                Referral        = new bool?(),
                CreateTime      = new wkt::Timestamp(),
                UpdateTime      = new wkt::Timestamp(),
                OutcomeNotes    = "outcome_notes38ed921d",
                Outcome         = Outcome.Neutral,
                IsMatch         = new bool?(),
                JobTitleSnippet = "job_title_snippet4f14afe7",
                ExternalId      = "external_id9442680e",
            };

            mockGrpcClient.Setup(x => x.UpdateApplication(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            Application response            = client.UpdateApplication(request.Application);

            xunit::Assert.Same(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
Beispiel #5
0
 /// <summary>Snippet for GetCompany</summary>
 public void GetCompanyResourceNames()
 {
     // Snippet: GetCompany(CompanyName, CallSettings)
     // Create client
     CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
     // Initialize request argument(s)
     CompanyName name = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]");
     // Make the request
     Company response = companyServiceClient.GetCompany(name);
     // End snippet
 }
Beispiel #6
0
        /// <summary>Snippet for DeleteCompanyAsync</summary>
        public async Task DeleteCompanyResourceNamesAsync()
        {
            // Snippet: DeleteCompanyAsync(CompanyName, CallSettings)
            // Additional: DeleteCompanyAsync(CompanyName, CancellationToken)
            // Create client
            CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync();

            // Initialize request argument(s)
            CompanyName name = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]");
            // Make the request
            await companyServiceClient.DeleteCompanyAsync(name);

            // End snippet
        }
Beispiel #7
0
 /// <summary>Snippet for GetCompany</summary>
 public void GetCompanyRequestObject()
 {
     // Snippet: GetCompany(GetCompanyRequest, CallSettings)
     // Create client
     CompanyServiceClient companyServiceClient = CompanyServiceClient.Create();
     // Initialize request argument(s)
     GetCompanyRequest request = new GetCompanyRequest
     {
         CompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
     };
     // Make the request
     Company response = companyServiceClient.GetCompany(request);
     // End snippet
 }
Beispiel #8
0
        public void DeleteCompanyResourceNames()
        {
            moq::Mock <CompanyService.CompanyServiceClient> mockGrpcClient = new moq::Mock <CompanyService.CompanyServiceClient>(moq::MockBehavior.Strict);
            DeleteCompanyRequest request = new DeleteCompanyRequest
            {
                CompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteCompany(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse);
            CompanyServiceClient client = new CompanyServiceClientImpl(mockGrpcClient.Object, null);

            client.DeleteCompany(request.CompanyName);
            mockGrpcClient.VerifyAll();
        }
Beispiel #9
0
        /// <summary>Snippet for DeleteCompanyAsync</summary>
        public async Task DeleteCompanyRequestObjectAsync()
        {
            // Snippet: DeleteCompanyAsync(DeleteCompanyRequest, CallSettings)
            // Additional: DeleteCompanyAsync(DeleteCompanyRequest, CancellationToken)
            // Create client
            CompanyServiceClient companyServiceClient = await CompanyServiceClient.CreateAsync();

            // Initialize request argument(s)
            DeleteCompanyRequest request = new DeleteCompanyRequest
            {
                CompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
            };
            // Make the request
            await companyServiceClient.DeleteCompanyAsync(request);

            // End snippet
        }
Beispiel #10
0
        public async stt::Task DeleteCompanyResourceNamesAsync()
        {
            moq::Mock <CompanyService.CompanyServiceClient> mockGrpcClient = new moq::Mock <CompanyService.CompanyServiceClient>(moq::MockBehavior.Strict);
            DeleteCompanyRequest request = new DeleteCompanyRequest
            {
                CompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
            };
            wkt::Empty expectedResponse = new wkt::Empty {
            };

            mockGrpcClient.Setup(x => x.DeleteCompanyAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <wkt::Empty>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            CompanyServiceClient client = new CompanyServiceClientImpl(mockGrpcClient.Object, null);
            await client.DeleteCompanyAsync(request.CompanyName, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            await client.DeleteCompanyAsync(request.CompanyName, st::CancellationToken.None);

            mockGrpcClient.VerifyAll();
        }
Beispiel #11
0
 /// <summary>Snippet for CompleteQuery</summary>
 public void CompleteQueryRequestObject()
 {
     // Snippet: CompleteQuery(CompleteQueryRequest, CallSettings)
     // Create client
     CompletionClient completionClient = CompletionClient.Create();
     // Initialize request argument(s)
     CompleteQueryRequest request = new CompleteQueryRequest
     {
         ParentAsTenantOrProjectName = TenantOrProjectName.FromProjectTenant("[PROJECT]", "[TENANT]"),
         Query                = "",
         LanguageCodes        = { "", },
         PageSize             = 0,
         CompanyAsCompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
         Scope                = CompleteQueryRequest.Types.CompletionScope.Unspecified,
         Type = CompleteQueryRequest.Types.CompletionType.Unspecified,
     };
     // Make the request
     CompleteQueryResponse response = completionClient.CompleteQuery(request);
     // End snippet
 }
Beispiel #12
0
        public async stt::Task CreateCompanyRequestObjectAsync()
        {
            moq::Mock <CompanyService.CompanyServiceClient> mockGrpcClient = new moq::Mock <CompanyService.CompanyServiceClient>(moq::MockBehavior.Strict);
            CreateCompanyRequest request = new CreateCompanyRequest
            {
                ParentAsProjectName = gagr::ProjectName.FromProject("[PROJECT]"),
                Company             = new Company(),
            };
            Company expectedResponse = new Company
            {
                CompanyName         = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                DisplayName         = "display_name137f65c2",
                ExternalId          = "external_id9442680e",
                Size                = CompanySize.Mini,
                HeadquartersAddress = "headquarters_address64cd7eb7",
                HiringAgency        = true,
                EeoText             = "eeo_text70a1a576",
                WebsiteUri          = "website_urid0c5dfce",
                CareerSiteUri       = "career_site_uri62d45b74",
                ImageUri            = "image_urieba3b1bc",
                KeywordSearchableJobCustomAttributes =
                {
                    "keyword_searchable_job_custom_attributese72ec77c",
                },
                DerivedInfo = new Company.Types.DerivedInfo(),
                Suspended   = true,
            };

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

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Company responseCancellationToken = await client.CreateCompanyAsync(request, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }
Beispiel #13
0
        public async stt::Task CreateApplicationResourceNamesAsync()
        {
            moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict);
            CreateApplicationRequest request = new CreateApplicationRequest
            {
                ParentAsProfileName = ProfileName.FromProjectTenantProfile("[PROJECT]", "[TENANT]", "[PROFILE]"),
                Application         = new Application(),
            };
            Application expectedResponse = new Application
            {
                ApplicationName      = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"),
                Profile              = "profile1b48977d",
                JobAsJobName         = JobName.FromProjectJob("[PROJECT]", "[JOB]"),
                CompanyAsCompanyName = CompanyName.FromProjectCompany("[PROJECT]", "[COMPANY]"),
                ApplicationDate      = new gt::Date(),
                Stage           = Application.Types.ApplicationStage.OfferAccepted,
                State           = Application.Types.ApplicationState.Unspecified,
                Interviews      = { new Interview(), },
                Referral        = new bool?(),
                CreateTime      = new wkt::Timestamp(),
                UpdateTime      = new wkt::Timestamp(),
                OutcomeNotes    = "outcome_notes38ed921d",
                Outcome         = Outcome.Neutral,
                IsMatch         = new bool?(),
                JobTitleSnippet = "job_title_snippet4f14afe7",
                ExternalId      = "external_id9442680e",
            };

            mockGrpcClient.Setup(x => x.CreateApplicationAsync(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(new grpccore::AsyncUnaryCall <Application>(stt::Task.FromResult(expectedResponse), null, null, null, null));
            ApplicationServiceClient client  = new ApplicationServiceClientImpl(mockGrpcClient.Object, null);
            Application responseCallSettings = await client.CreateApplicationAsync(request.ParentAsProfileName, request.Application, gaxgrpc::CallSettings.FromCancellationToken(st::CancellationToken.None));

            xunit::Assert.Same(expectedResponse, responseCallSettings);
            Application responseCancellationToken = await client.CreateApplicationAsync(request.ParentAsProfileName, request.Application, st::CancellationToken.None);

            xunit::Assert.Same(expectedResponse, responseCancellationToken);
            mockGrpcClient.VerifyAll();
        }