Exemple #1
0
        public HolidayTests(ITestOutputHelper output)
        {
            _output = output;
            var setup = new SetUp();

            setup.Initialize();
            _context = setup.HolidayDbContext;
            var mapper      = setup.Mapper;
            var userManager = setup.InitializeUserManager();

            _holidaysCount = setup.GetCount("holidays");
            _configuration = setup.GetConfiguration();
            _timeService   = new TimeService();
            var mockUserService     = new Mock <IUserService>().Object;
            var mockOvertimeUtility = new Mock <IOvertimeUtility>().Object;

            _holidaysRepository  = new HolidaysRepository(_context);
            _employeesRepository = new EmployeesRepository(_context, userManager);
            _clientsRepository   = new ClientsRepository(_context);
            var holidayGuidsRepository          = new HolidayGuidsRepository(_context);
            var mockNotificationSettingsService = new Mock <INotificationSettingsService>().Object;

            _employeesService = new EmployeesService(_employeesRepository, mapper, mockOvertimeUtility, _timeService,
                                                     mockUserService, mockNotificationSettingsService, _configuration);
            _holidaysService = new HolidaysService(_holidaysRepository, _employeesRepository, mapper, _timeService,
                                                   mockOvertimeUtility, _clientsRepository, mockUserService, _configuration, holidayGuidsRepository);
        }