public void Submit_PerformsCorrectRequest() { //Setup var request = new SubmitApplicationRequestStub("DevKey", "api.careerbuilder.com", "", "", 12345); var dummyApp = new RequestApplication(); //Mock crap var response = new RestResponse <ResponseApplication> { Data = new ResponseApplication(), ResponseStatus = ResponseStatus.Completed }; var restReq = new Mock <IRestRequest>(); restReq.Setup(x => x.AddBody(dummyApp)); var restClient = new Mock <IRestClient>(); restClient.SetupSet(x => x.BaseUrl = "https://api.careerbuilder.com/v1/application/submit"); restClient.Setup(x => x.Execute <ResponseApplication>(It.IsAny <IRestRequest>())).Returns(response); request.Request = restReq.Object; request.Client = restClient.Object; //Assert ResponseApplication resp = request.Submit(dummyApp); restReq.VerifyAll(); restClient.VerifyAll(); }
/// <summary> /// Submit an application to /v1/application/submit /// </summary> /// <param name="app">The application being submited to careerbuilder</param> /// <returns></returns> public ResponseApplication SubmitApplication(RequestApplication app) { var req = new SubmitApplicationRequest(_Settings); WireBeforeRequestEvents(req); WireAfterRequestEvents(req); return(req.Submit(app)); }
public ResponseApplication Submit(RequestApplication app) { _request.AddBody(app); base.BeforeRequest(); IRestResponse <ResponseApplication> response = _client.Execute <ResponseApplication>(_request); CheckForErrors(response); return(response.Data); }
public AbstractRequestFormBC(IDbFactory dbFactory, IDbFactory dbDocFactory) { this._transactionHistoryRepository = new TransactionHistoryRepository(dbFactory); this._documentRepository = new DocumentRepository(dbFactory); this.requestHeaderRepository = new RequestHeaderRepository(dbFactory); this.activityHistoryRepository = new ActivityHistoryRepository(dbFactory); this._wlRepo = new WMRepository(dbFactory); this.employeeRepository = new EmployeeRepository(dbFactory); this.unitOfWork = new UnitOfWork(dbFactory); this.fileAttachementRepository = new AttachementRepository <FileTemp>(dbDocFactory); this.repository = new Repository(); //Adding by default since all work flow get view activity for users AddActivities(new DefaultActivity <E>(FORM_VIEW)); REQ_APP = _wlRepo.GetReqAppByCode(GetRequestCode()); REQ_CODE = REQ_APP.RequestCode; ActivityList = _wlRepo.GetActivitiesByReqCode(REQ_APP.RequestCode); _processFolderName = ConfigurationManager.AppSettings["ProcessFolderName"] ?? "Nagaworld\\"; InitActivityConfiguration(); }
/// <summary> /// Submit an application to /v1/application/submit /// </summary> /// <param name="app">The application being submited to careerbuilder</param> /// <returns></returns> public ResponseApplication SubmitApplication(Application app) { RequestApplication req = new RequestApplication(); req.CoBrand = app.CoBrand; req.DeveloperKey = app.DeveloperKey; req.JobDID = app.JobDID; req.SiteID = app.SiteID; req.Test = app.Test; req.Resume = app.Resume; List <Response> responses = new List <Response>(); foreach (var item in app.Questions) { responses.Add(new Response() { QuestionID = item.QuestionID, ResponseText = item.ResponseText }); } req.Responses = responses; return(SubmitApplication(req)); }
public RequestApplication UpdateApplication(RequestApplication entity) { Update(entity); return(entity); }
public void DeleteApplication(RequestApplication entity) { Delete(entity); }
public RequestApplication AddApplication(RequestApplication entity) { Add(entity); return(entity); }