public void SetUp()
        {
            _repoUnit = new RepoUnit();
            Ioc.RegisterInstance<RepoUnit>(_repoUnit);

            _users.Values.ToList().ForEach(_repoUnit.User.Save);

            _service = new EventSavingService(_repoUnit);
            Ioc.RegisterInstance<EventSavingService>(_service);
        }
Example #2
0
        public HomeService(UsersRules rules, RepoUnit unit, EventSavingService calendarEventService)
        {
            _savingService = calendarEventService;
            _rules = rules;
            _unit = unit;
            var users = unit.User.Load();
            if (!users.Any())
            {
                var defaultUser = new User
                {
                    BirthDate = null,
                    Email = "Admin",
                    FirstName = "Admin",
                    LastName = "Admin",
                    Role = Roles.Admin,
                    PasswordHash = "Admin",
                    PasswordSalt = "",

                    Live = LiveStatuses.Active,
                    ApproveState = ApproveStates.Approved
                };
                unit.User.Save(defaultUser);
            }
        }
Example #3
0
 public EventService(RepoUnit repoUnit, EventSavingService eventSavingService)
 {
     _unit = repoUnit;
     _savingService = eventSavingService;
 }