public void InitializeTest()
 {
     _TestTransaction = new TransactionScope();
     try
     {
         IRepositoryContainer educationContainer = MockRepository.GenerateMock<IRepositoryContainer>();
         EducationDataContext = new EducationDataContext();
         educationContainer.Expect(m => m.Obtain<IUserRepository>()).Return(new UserRepository(EducationDataContext));
         educationContainer.Expect(m => m.Obtain<IEulaAgreementRepository>()).Return(new EulaAgreementRepository(EducationDataContext));
         MockWindsorContainer = MockRepository.GenerateMock<IWindsorContainer>();
         MockWindsorContainer.Expect(m => m.Resolve<IRepositoryContainer>()).Return(educationContainer);
         AccountManager = new AccountManager(MockWindsorContainer, MockRepository.GenerateMock<IEmailConfirmationManager>(), new DataTableBinder(), new UserAuditor());
         MockDependecyResolver = MockRepository.GenerateMock<IDependencyResolver>();
         MockDependecyResolver.Expect(m => m.GetService(typeof(IAccountManager))).Return(AccountManager);
         DependencyResolver.SetResolver(MockDependecyResolver);
     }
     catch (Exception)
     {
         _TestTransaction.Dispose();
         _TestTransaction = null;
         if (EducationDataContext != null)
         {
             EducationDataContext.Dispose();
             EducationDataContext = null;
         }
         throw;
     }
 }
 public void InitializeTest()
 {
     Users = Data.Users;
     MockWindsorContainer = MockRepository.GenerateMock<IWindsorContainer>();
     MockWindsorContainer.Expect(m => m.Resolve<IRepositoryContainer>()).Return(Repositories.MockRepositoryContainer);
     MockEmailConfirmationManager = MockRepository.GenerateMock<IEmailConfirmationManager>();
     MockUserAuditor = MockRepository.GenerateMock<IUserAuditor>();
     Target = new AccountManager(MockWindsorContainer, MockEmailConfirmationManager, MockDataTableBinder, MockUserAuditor);
     MockSecurityConfiguration = MockRepository.GenerateMock<ISecurityConfiguration>();
     MockSecurityConfiguration.Expect(m => m.AdministratorEmailAddresses).Return(Enumerable.Empty<string>());
 }
 public void InitializeTest()
 {
     EducationContext = new EducationDataContext();
     Container = AssemblySetup.CreateWindsorContainer(EducationContext);
     Target = new AccountManager(Container, new EmailConfirmationManager(new Mailer()), new DataTableBinder(), new UserAuditor());
 }