public void FetchJobListWithFilledDoesntThrow() { LinqToDB.Common.Configuration.Linq.GenerateExpressionTest = true; var job = _sf.InsertJob(); _sf.InsertRole(job.Id, active: true); var jobs = _js.JobWithFilledInfos(); jobs.ShouldNotBeNull(); jobs.ShouldNotBeEmpty(); }
public void StaffOrgGroupIdNotUpdatedOnExistingRoleUpdated() { var job = _servicesFixture.InsertJob(); Assert.NotEqual(Guid.Empty, job.OrgGroupId); var person = _servicesFixture.InsertPerson(); Assert.NotEqual(job.OrgGroupId, person.Staff.OrgGroupId); var role = _servicesFixture.InsertRole(); role.Active = true; role.JobId = job.Id; role.PersonId = person.Id; _personService.Save(role); var currentOrgGroupId = _db.Staff.Single(s => s.Id == person.StaffId).OrgGroupId; Assert.Equal(person.Staff.OrgGroupId, currentOrgGroupId); Assert.NotEqual(job.OrgGroupId, currentOrgGroupId); }
public void NotifiesHrWhenAppropriate(LeaveRequest request, PersonWithStaff personWithStaff, int usedLeave, int totalYears, bool expectedEmailed) { var job = _servicesFixture.InsertJob(j => { //force job to provide time off j.Type = JobType.FullTime; j.OrgGroup.Type = GroupType.Department; }); _dbConnection.Insert(personWithStaff); _dbConnection.Insert(personWithStaff.Staff); //create roles for # of years _servicesFixture.InsertRole(job.Id, personWithStaff.Id, totalYears); //insert used leave _servicesFixture.InsertLeaveRequest(request.Type, personWithStaff.Id, usedLeave); var actualEmailed = _leaveService.ShouldNotifyHr(request, _leaveService.GetCurrentLeaveUseage(request.Type, personWithStaff.Id)); Assert.Equal(expectedEmailed, actualEmailed); }