Esempio n. 1
0
        public void Transaction_Test()
        {
            var factory = new AdoNetFactory();

            var uow = new ADOUnitOfWork(factory);

            var turmaRepository = new TurmaRepositorySql(factory);
        }
Esempio n. 2
0
 public DatabaseTestInitializer(IUnitOfWork Uow, AdoNetFactory factory)
 {
     repo = new RepositoryBaseADO(factory);
     Truncate();
     Uow.Commit();
     Seed();
     Uow.Commit();
 }
Esempio n. 3
0
        public override void Initialize()
        {
            base.Initialize();

            Factory = new AdoNetFactory();

            Uow = new ADOUnitOfWork(Factory);

            new DatabaseTestInitializer(Uow, Factory);

            AlunoRepository    = new AlunoRepositorySql(Factory);
            TurmaRepository    = new TurmaRepositorySql(Factory);
            AulaRepository     = new AulaRepositorySql(Factory);
            PresencaRepository = new PresencaRepositorySql(Factory);
        }
Esempio n. 4
0
        public override void Load()
        {
            var factory = new AdoNetFactory();
            var type    = factory.GetType();

            Bind <IUnitOfWork>().To <ADOUnitOfWork>().WithConstructorArgument(type, factory);
            Bind <ITurmaRepository>().To <TurmaRepositorySql>().WithConstructorArgument(type, factory);
            Bind <IAulaRepository>().To <AulaRepositorySql>().WithConstructorArgument(type, factory);
            Bind <IAlunoRepository>().To <AlunoRepositorySql>().WithConstructorArgument(type, factory);

            var authFactory = new AuthFactory();
            var typeAuth    = authFactory.GetType();

            Bind <IAuthUnitOfWork>().To <AuthUnitOfWork>().WithConstructorArgument(typeAuth, authFactory);
            Bind <IUserStore <User> >().To <IdentityUserStore>().WithConstructorArgument(typeAuth, authFactory);
            Bind <IAccountRepository>().To <AccountRepository>().WithConstructorArgument(typeAuth, authFactory);
            Bind <IGroupRepository>().To <GroupRepository>().WithConstructorArgument(typeAuth, authFactory);
            Bind <IPermissionRepository>().To <PermissionRepository>().WithConstructorArgument(typeAuth, authFactory);
        }
Esempio n. 5
0
 public PresencaRepositorySql(AdoNetFactory factory)
     : base(factory)
 {
 }
Esempio n. 6
0
 public AulaRepositorySql(AdoNetFactory factory)
     : base(factory)
 {
     _repoPresenca = new PresencaRepositorySql(factory);
 }
Esempio n. 7
0
 public TurmaRepositorySql(AdoNetFactory factory)
     : base(factory)
 {
 }
Esempio n. 8
0
        public void Abrir_Conexao_Test()
        {
            var factory = new AdoNetFactory();

            Assert.IsTrue(factory.Connection.State == ConnectionState.Open); 
        }
Esempio n. 9
0
 public RepositoryBaseADO(AdoNetFactory factory)
 {
     _factory = factory;
 }