Пример #1
0
 public static UserModel GetUser(UserStatesEnum state = UserStatesEnum.Active)
 {
     return(new UserModel()
     {
         Password = "******",
         Salt = "salt",
         State = state,
         FirstName = "test",
         LastName = "test",
         CreatedAt = DateTime.Now,
         Id = HelperConstants.TestEmailAddress,
         Roles = new List <string>()
     });
 }
Пример #2
0
        private SettingsController SetUpBasicUserValidation(string name, UserStatesEnum state = UserStatesEnum.Active)
        {
            _repository.Setup(repo => repo.GetById <UserModel, string>(name, null)).Returns(HelperObjects.GetUser(state));
            var controller = CreateController();

            controller.ControllerContext = new ControllerContext()
            {
                HttpContext = new DefaultHttpContext()
                {
                    User = _user
                }
            };
            return(controller);
        }