예제 #1
0
 public JobHistoryCompanyServiceTest()
 {
     TecAppContext            = new TecAppContext();
     JobHistoryService        = new JobHistoryService.JobHistoryService(TecAppContext);
     CompanyService           = new CompanyService.CompanyService(TecAppContext);
     JobHistoryCompanyService = new JobHistoryCompanyService(TecAppContext);
     End = false;
 }
예제 #2
0
        public void GetTest()
        {
            if (End)
            {
                return;
            }
            var added = JobHistoryCompanyService.GetFromIdPair(JobHistory.Id, Company.Id);

            Assert.AreEqual(added.Id, JobHistoryCompany.Id);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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
            });
        }