public SubstitutesController(IServiceProvider provider) : base(provider) { _sub = provider.GetService <ISubstituteService>(); _driveRepo = provider.GetService <IGenericRepository <DriveReport> >(); _orgService = provider.GetService <IOrgUnitService>(); _driveService = provider.GetService <IDriveReportService>(); }
public SubstituteService(IGenericRepository <Substitute> subRepo, IOrgUnitService orgService, IDriveReportService driveService, IGenericRepository <DriveReport> driveRepo) { _subRepo = subRepo; _orgService = orgService; _driveService = driveService; _driveRepo = driveRepo; }
public SubstituteService(IGenericRepository <Substitute> subRepo, IOrgUnitService orgService, IGenericRepository <Report> reportRepo, IReportService <Report> reportService) { _subRepo = subRepo; _orgService = orgService; _reportService = reportService; _reportRepo = reportRepo; }
//GET: odata/Substitutes public SubstitutesController(IGenericRepository <Substitute> repository, ISubstituteService sub, IGenericRepository <Person> personRepo, IGenericRepository <DriveReport> driveRepo, IOrgUnitService orgService, IDriveReportService driveService) : base(repository, personRepo) { _sub = sub; _driveRepo = driveRepo; _orgService = orgService; _driveService = driveService; }
public OrganizationUnitRightController( IGenericRepository <OrganizationUnitRight> rightRepository, IGenericRepository <OrganizationUnit> objectRepository, IDomainEvents domainEvents, IOrgUnitService orgUnitService) : base(rightRepository, objectRepository, domainEvents) { _orgUnitService = orgUnitService; }
public ResponsibilityController(IMenuService menuProvider, IResponsibilityService responibilityProvider, IOrgUnitService organizationUnitProvider, IMapper mapper) { _menuProvider = menuProvider; _responibilityProvider = responibilityProvider; _organizationUnitProvider = organizationUnitProvider; _mapper = mapper; }
public PersonController(IGenericRepository <Person> repo, IPersonService personService, IGenericRepository <Employment> employmentRepo, IGenericRepository <LicensePlate> licensePlateRepo, IGenericRepository <Substitute> substituteRepo, IGenericRepository <AppLogin> appLoginRepo, IOrgUnitService orgService, IGenericRepository <Report> reportRepo) : base(repo, repo) { _person = personService; _employmentRepo = employmentRepo; _licensePlateRepo = licensePlateRepo; _substituteRepo = substituteRepo; _appLoginRepo = appLoginRepo; _orgService = orgService; _reportRepo = reportRepo; }
public OrganizationUnitController( IGenericRepository <OrganizationUnit> repository, IOrgUnitService orgUnitService, IGenericRepository <TaskRef> taskRepository, IGenericRepository <TaskUsage> taskUsageRepository) : base(repository) { _orgUnitService = orgUnitService; _taskRepository = taskRepository; _taskUsageRepository = taskUsageRepository; }
public OrgUnitsController(IGenericRepository <OrgUnit> repo, IGenericRepository <Person> personRepo, IOrgUnitService orgService) : base(repo, personRepo) { _orgService = orgService; }
public void SetUp() { _orgService = NSubstitute.Substitute.For <IOrgUnitService>(); _repoMock = NSubstitute.Substitute.For <IGenericRepository <Substitute> >(); _driveRepo = NSubstitute.Substitute.For <IGenericRepository <DriveReport> >(); _emplMock = NSubstitute.Substitute.For <IGenericRepository <Employment> >(); _orgUnitMock = NSubstitute.Substitute.For <IGenericRepository <OrgUnit> >(); _driveService = NSubstitute.Substitute.For <IDriveReportService>(); _repo = new List <Substitute> { new Substitute() { Sub = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, Leader = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, Person = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, }, new Substitute() { Sub = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, Leader = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, Person = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, } }; var leader1 = new Person() { Id = 1, FirstName = "Test", LastName = "Testesen", Initials = "TT", FullName = "Test Testesen [TT]" }; var leader2 = new Person() { Id = 3, FirstName = "Test2", LastName = "Testesen2", Initials = "2", FullName = "Test Testesen [2]" }; var user1 = new Person() { Id = 2, FirstName = "User", LastName = "Usersen", Initials = "UU", FullName = "User Usersen [UU]" }; var user2 = new Person() { Id = 4, FirstName = "User", LastName = "Usersen", Initials = "UU", FullName = "User Usersen [UU]" }; var orgUnit = new OrgUnit() { Id = 1, }; var orgUnit2 = new OrgUnit() { Id = 12, }; var leaderEmpl1 = new Employment() { Id = 1, OrgUnitId = 1, OrgUnit = orgUnit, Person = leader1, PersonId = leader1.Id, IsLeader = true }; var leaderEmpl2 = new Employment() { Id = 2, OrgUnitId = 2, OrgUnit = orgUnit2, Person = leader1, PersonId = leader1.Id, IsLeader = true }; var userEmpl1 = new Employment() { Id = 3, OrgUnitId = 1, OrgUnit = orgUnit, Person = user1, PersonId = user1.Id, IsLeader = false }; var userEmpl2 = new Employment() { Id = 4, OrgUnitId = 2, OrgUnit = orgUnit2, Person = user2, PersonId = user2.Id, IsLeader = false }; _emplMock.AsQueryable().ReturnsForAnyArgs(new List <Employment>() { leaderEmpl1, userEmpl1, leaderEmpl2, userEmpl2 }.AsQueryable()); _orgUnitMock.AsQueryable().ReturnsForAnyArgs(new List <OrgUnit>() { orgUnit, orgUnit2 }.AsQueryable()); var reports = new List <DriveReport>() { new DriveReport() { Id = 1, Employment = userEmpl1, EmploymentId = userEmpl1.Id, PersonId = user1.Id, Person = user1, }, new DriveReport() { Id = 2, Employment = userEmpl1, EmploymentId = userEmpl1.Id, PersonId = user1.Id, Person = user1, }, new DriveReport() { Id = 3, Employment = userEmpl2, EmploymentId = userEmpl2.Id, PersonId = user2.Id, Person = user2, }, new DriveReport() { Id = 4, Employment = userEmpl2, EmploymentId = userEmpl2.Id, PersonId = user2.Id, Person = user2, }, new DriveReport() { Id = 5, Employment = leaderEmpl1, EmploymentId = leaderEmpl1.Id, PersonId = 1 }, new DriveReport() { Id = 6, Employment = leaderEmpl2, EmploymentId = leaderEmpl2.Id, PersonId = 3 } }; _driveRepo.AsQueryable().ReturnsForAnyArgs(reports.AsQueryable()); _uut = new SubstituteService(_repoMock, _orgService, _driveService, _driveRepo, _logger); }
public OrgUnitsController(IServiceProvider provider) : base(provider) { _orgService = provider.GetService <IOrgUnitService>(); _person = provider.GetService <IPersonService>(); }
public OrgUnitsController(IGenericRepository <OrgUnit> repo, IGenericRepository <Person> personRepo, IOrgUnitService orgService, ILogger <OrgUnit> logger, UserManager <IdentityPerson> userManager) : base(repo, personRepo, logger, userManager) { _orgService = orgService; }
public void SetUp() { _orgService = NSubstitute.Substitute.For <IOrgUnitService>(); _repoMock = NSubstitute.Substitute.For <IGenericRepository <Substitute> >(); _reportRepo = NSubstitute.Substitute.For <IGenericRepository <Report> >(); _reportService = NSubstitute.Substitute.For <IReportService <Report> >(); _repo = new List <Substitute> { new Substitute() { Sub = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, Leader = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, Person = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, }, new Substitute() { Sub = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, Leader = new Person() { CprNumber = "123123", FirstName = "Morten", LastName = "Rasmussen", Initials = "MR" }, Person = new Person() { CprNumber = "123123", FirstName = "Jacob", LastName = "Jensen", Initials = "JOJ" }, } }; _uut = new SubstituteService(_repoMock, _orgService, _reportRepo, _reportService); }