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);
        }
Exemplo n.º 2
0
 protected void BaseSetup()
 {
     _appSensor          = MockRepository.GenerateMock <IAppSensor>();
     _context            = MockRepository.GenerateStub <ISEContext>();
     _context.LookupItem = new TestDbSet <LookupItem>();
     _context.User       = new TestDbSet <User>();
     _context.User.Add(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>();
     _httpContext.Stub(c => c.Request).Return(_httpRequest);
     _httpContext.Stub(c => c.Session).Return(_httpSession);
 }