public void Setup() { _context = MockRepository.GenerateStub <ISeContext>(); _context.LookupItem = new TestDbSet <LookupItem> { new LookupItem { LookupTypeId = Consts.LookupTypeId.BadPassword, Description = "Password1" }, new LookupItem { LookupTypeId = Consts.LookupTypeId.BadPassword, Description = "LetMeIn123" }, new LookupItem { LookupTypeId = Consts.LookupTypeId.SecurityQuestion, Id = 142 } }; _context.User = new TestDbSet <User>(); _context.UserLog = new TestDbSet <UserLog>(); _configuration = MockRepository.GenerateStub <IAppConfiguration>(); _encryption = MockRepository.GenerateMock <IEncryption>(); _services = MockRepository.GenerateMock <IServices>(); _userStore = MockRepository.GenerateMock <IAppUserStore <User> >(); _bannedWords = new List <string> { "First Name", "SurName", "My Town", "My PostCode" }; _pwnedPasswordValidator = MockRepository.GenerateMock <IPwnedPasswordValidator>(); _sut = new AppUserManager(_configuration, _context, _encryption, _pwnedPasswordValidator, _services, _userStore); }
public UserController(IAppSensor appSensor, IAppConfiguration configuration, ISeContext context, IHttpCache httpCache, IUserIdentity userIdentity, IUserManager userManager, IServices services) : base(userIdentity, appSensor) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _context = context ?? throw new ArgumentNullException(nameof(context)); _httpCache = httpCache ?? throw new ArgumentNullException(nameof(httpCache)); _services = services ?? throw new ArgumentNullException(nameof(services)); _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager)); }
public AppUserManager(IAppConfiguration configuration, ISeContext context, IEncryption encryption, IServices services, IAppUserStore <User> userStore) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _context = context ?? throw new ArgumentNullException(nameof(context)); _encryption = encryption ?? throw new ArgumentNullException(nameof(encryption)); _services = services ?? throw new ArgumentNullException(nameof(services)); _userStore = userStore ?? throw new ArgumentNullException(nameof(userStore)); }
public AccountController(IAppSensor appSensor, IAppConfiguration configuration, IEncryption encryption, IFormsAuth formsAuth, ISeContext context, IHttpCache httpCache, IUserManager userManager, IRecaptcha recaptcha, IServices services, IUserIdentity userIdentity) : base(userIdentity, appSensor) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _context = context ?? throw new ArgumentNullException(nameof(context)); _encryption = encryption ?? throw new ArgumentNullException(nameof(encryption)); _formsAuth = formsAuth ?? throw new ArgumentNullException(nameof(formsAuth)); _httpCache = httpCache ?? throw new ArgumentNullException(nameof(httpCache)); _recaptcha = recaptcha ?? throw new ArgumentNullException(nameof(recaptcha)); _services = services ?? throw new ArgumentNullException(nameof(services)); _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager)); }
public void Setup() { _context = MockRepository.GenerateStub <ISeContext>(); _context.User = new TestDbSet <User>(); _context.Stub(a => a.SaveChangesAsync()).Return(Task.FromResult(0)); _configuration = MockRepository.GenerateStub <IAppConfiguration>(); _testRoleName = "test Role"; TestUser = GetUser(); _context.User.Add(TestUser); _sut = new UserStore <User>(_context, _configuration); }
protected void BaseSetup() { Context = MockRepository.GenerateStub <ISeContext>(); Context.Log = new TestDbSet <Log>(); Context.LookupItem = new TestDbSet <LookupItem>(); Context.LookupType = new TestDbSet <LookupType>(); Context.PreviousPassword = new TestDbSet <PreviousPassword>(); Context.Role = new TestDbSet <Role>(); Context.User = new TestDbSet <User> { GetUser() }; Context.Stub(a => a.SaveChangesAsync()).Return(Task.FromResult(0)); UserIdentity = MockRepository.GenerateMock <IUserIdentity>(); HttpSession = MockRepository.GenerateMock <HttpSessionStateBase>(); HttpContext = MockRepository.GenerateMock <HttpContextBase>(); HttpRequest = MockRepository.GenerateMock <HttpRequestBase>(); HttpResponse = MockRepository.GenerateMock <HttpResponseBase>(); HttpServer = MockRepository.GenerateMock <HttpServerUtilityBase>(); HttpContext.Stub(c => c.Request).Return(HttpRequest); HttpContext.Stub(c => c.Session).Return(HttpSession); HttpContext.Stub(c => c.Server).Return(HttpServer); HttpContext.Stub(c => c.Response).Return(HttpResponse); }
public LogController(ISeContext context, IUserIdentity userIdentity, IAppSensor appSensor) : base(userIdentity, appSensor) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public UserStore(ISeContext context, IAppConfiguration configuration) { _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); _context = context ?? throw new ArgumentNullException(nameof(context)); }