Exemple #1
0
 public void InitializeTest()
 {
     EducationContext = new EducationDataContext();
     Container = AssemblySetup.CreateWindsorContainer(EducationContext);
     RepositoryContainer repositoryContainer = new RepositoryContainer(Container, EducationContext);
     Target = new SchoolDistrictManager(repositoryContainer, new DataTableBinder(), new UserAuditor());
     User = new EducationSecurityPrincipal(EducationContext.Users.Include("UserRoles.Role").Single(u => u.UserKey == "Bob"));
     MockContext = MockHttpContextFactory.Create();
 }
 public void InitializeTest()
 {
     EducationContext = new EducationDataContext();
     Container = AssemblySetup.CreateWindsorContainer(EducationContext);
     RepositoryContainer repositoryContainer = new RepositoryContainer(Container, EducationContext);
     Target = new SchoolDistrictManager(repositoryContainer, new DataTableBinder(), new UserAuditor());
     User = new EducationSecurityPrincipal(EducationContext.Users.Include("UserRoles.Role").Single(u => u.UserKey == "Bob"));
     MockContext = MockHttpContextFactory.Create();
 }
 public void InitializeTest()
 {
     MockUserAuditor = MockRepository.GenerateMock <IUserAuditor>();
     Target          = new SchoolDistrictManager(Repositories.MockRepositoryContainer, MockDataTableBinder, MockUserAuditor);
 }
 public void InitializeTest()
 {
     EducationContext = new EducationDataContext();
     Container = AssemblySetup.CreateWindsorContainer(EducationContext);
     RepositoryContainer repositoryContainer = new RepositoryContainer(Container, EducationContext);
     SchoolDistrictManager logicManager = new SchoolDistrictManager(repositoryContainer, new DataTableBinder(), new UserAuditor());
     Target = new StudentController(logicManager);
     User userEntity = EducationContext.Users.Include("UserRoles.Role").Include("UserRoles.Schools").Include("UserRoles.Providers").Single(s => s.UserKey == "Bob");
     User = new EducationSecurityPrincipal(userEntity);
     MockHttpContext = MockHttpContextFactory.Create();
     MockHttpContext.Expect(m => m.User).Return(User);
     ControllerContext context = new ControllerContext(MockHttpContext, new RouteData(), Target);
     Target.ControllerContext = context;
 }
 public void InitializeTest()
 {
     MockUserAuditor = MockRepository.GenerateMock<IUserAuditor>();
     Target = new SchoolDistrictManager(Repositories.MockRepositoryContainer, MockDataTableBinder, MockUserAuditor);
 }