public void TestInitialize() { MockAccountManager = MockRepository.GenerateMock <IAccountManager>(); MockDependecyResolver = MockRepository.GenerateMock <IDependencyResolver>(); MockDependecyResolver.Expect(m => m.GetService(typeof(IAccountManager))).Return(MockAccountManager); DependencyResolver.SetResolver(MockDependecyResolver); Target = new AuthenticateAndAuthorizeAttribute(); }
public void TestInitialize() { MockHttpContext = new HttpContext(new HttpRequest("", "http://tempuri.org", ""), new HttpResponse(new StringWriter())); MockHttpContextBase = new HttpContextWrapper(MockHttpContext); MockAccountManager = MockRepository.GenerateMock <IAccountManager>(); MockDependecyResolver = MockRepository.GenerateMock <IDependencyResolver>(); MockDependecyResolver.Expect(m => m.GetService(typeof(IAccountManager))).Return(MockAccountManager); DependencyResolver.SetResolver(MockDependecyResolver); HttpContext.Current = MockHttpContext; Target = new UserIdentityMapAttribute(); }