public UnitOfWork(PsychoContext context) { _context = context; Roles = new RoleRepository(_context); Users = new UserRepository(_context); Psychologists = new PsychologistRepository(_context); AuthorizedUsers = new AuthorizedUserRepository(_context); AnonymousUsers = new AnonymousUserRepository(_context); Appointments = new AppointmentRepository(_context); AppointmentResults = new AppointmentResultRepository(_context); Reports = new ReportRepository(_context); Chats = new ChatRepository(_context); WorkSchedules = new WorkScheduleRepository(_context); }
public void CreateNewScheduleRepo() { WorkScheduleRepository wsp = WorkScheduleRepository.GetInstance(); WorkSchedule first = new WorkSchedule(2018, 3); WorkSchedule second = new WorkSchedule(2018, 4); WorkSchedule third = new WorkSchedule(2018, 5); WorkSchedule fourth = new WorkSchedule(2018, 6); wsp.AddWorkSchedule(first); wsp.AddWorkSchedule(second); wsp.AddWorkSchedule(third); wsp.AddWorkSchedule(fourth); Assert.AreEqual(4, wsp.GetAllWorkSchedules().Count); Assert.AreEqual(5, wsp.GetSchedule(2018, 5).Month); Assert.AreEqual(null, wsp.GetSchedule(2017, 1)); }
public WorkScheduleServices(WorkScheduleRepository repository) { _repository = repository; }