public void GetApplicationResourceNames() { moq::Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new moq::Mock <ApplicationService.ApplicationServiceClient>(moq::MockBehavior.Strict); GetApplicationRequest request = new GetApplicationRequest { ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"), }; Application expectedResponse = new Application { ApplicationName = ApplicationName.FromProjectTenantProfileApplication("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"), Profile = "profile1b48977d", JobAsJobName = JobName.FromProjectTenantJob("[PROJECT]", "[TENANT]", "[JOB]"), CompanyAsCompanyName = CompanyName.FromProjectTenantCompany("[PROJECT]", "[TENANT]", "[COMPANY]"), ApplicationDate = new gt::Date(), Stage = Application.Types.ApplicationStage.OfferAccepted, State = Application.Types.ApplicationState.Unspecified, Interviews = { new Interview(), }, Referral = false, CreateTime = new wkt::Timestamp(), UpdateTime = new wkt::Timestamp(), OutcomeNotes = "outcome_notes38ed921d", Outcome = Outcome.Neutral, IsMatch = false, JobTitleSnippet = "job_title_snippet4f14afe7", ExternalId = "external_id9442680e", }; mockGrpcClient.Setup(x => x.GetApplication(request, moq::It.IsAny <grpccore::CallOptions>())).Returns(expectedResponse); ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null); Application response = client.GetApplication(request.ApplicationName); xunit::Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
public void GetApplication2() { Mock <ApplicationService.ApplicationServiceClient> mockGrpcClient = new Mock <ApplicationService.ApplicationServiceClient>(MockBehavior.Strict); GetApplicationRequest request = new GetApplicationRequest { ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"), }; Application expectedResponse = new Application { ApplicationName = new ApplicationName("[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]"), ExternalId = "externalId-1153075697", Profile = "profile-309425751", Job = "job105405", Company = "company950484093", OutcomeNotes = "outcomeNotes-355961964", JobTitleSnippet = "jobTitleSnippet-1100512972", }; mockGrpcClient.Setup(x => x.GetApplication(request, It.IsAny <CallOptions>())) .Returns(expectedResponse); ApplicationServiceClient client = new ApplicationServiceClientImpl(mockGrpcClient.Object, null); Application response = client.GetApplication(request); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }