public JobHistoryCompanyServiceTest() { TecAppContext = new TecAppContext(); JobHistoryService = new JobHistoryService.JobHistoryService(TecAppContext); CompanyService = new CompanyService.CompanyService(TecAppContext); JobHistoryCompanyService = new JobHistoryCompanyService(TecAppContext); End = false; }
public void GetTest() { if (End) { return; } var added = JobHistoryCompanyService.GetFromIdPair(JobHistory.Id, Company.Id); Assert.AreEqual(added.Id, JobHistoryCompany.Id); }
public void RemoveTest() { if (End) { return; } JobHistoryCompanyService.Remove(JobHistory.Id, Company.Id); var removed = JobHistoryCompanyService.GetFromIdPair(JobHistory.Id, Company.Id); Assert.AreEqual(removed.Id, -1); }
public void AddTest() { var random = new Random(); var count = JobHistoryService.GetAllJobHistories().Count; var allJobHistories = JobHistoryService.GetAllJobHistories(); if (count == 0) { End = true; return; } JobHistory = allJobHistories[random.Next(count)]; Company = CompanyService.GetAllCompanies()[random.Next(CompanyService.GetAllCompanies().Count)]; JobHistoryCompany = JobHistoryCompanyService.Add(new JobHistory_Company() { JobHistory = JobHistory, JobHistoryId = JobHistory.Id, Company = Company, CompanyId = Company.Id }); }