Exemplo n.º 1
0
        public DBaseErrorsReportingServiceTest()
        {
            this.container = new UnityContainer();

            this.container.RegisterType <IErrorsReportingContext, ErrorsReportingContext>(new HierarchicalLifetimeManager());
            this.container.RegisterType(typeof(IGenericRepository <>), typeof(GenericRepository <>));
            this.container.RegisterType <IErrorsReportingService, ErrorsReportingService>();

            this.dataSet = new PersistentErrorsReportingDataSet();

            this.connection          = new SqlConnection(DatabaseConfiguration.ErrorsReportingConnectionString);
            this.exceptionsSqlHelper = new ExceptionsSqlHelper(this.connection);
        }
Exemplo n.º 2
0
        public DBaseErrorsReportingServiceTest()
        {
            this.dataSet = new PersistentErrorsReportingDataSet();

            this.connection          = new SqlConnection(DatabaseConfiguration.ErrorsReportingConnectionString);
            this.exceptionsSqlHelper = new ExceptionsSqlHelper(this.connection);

            container.Options.DefaultScopedLifestyle = new ThreadScopedLifestyle();
            container.Register <IDbContext, ErrorsReportingContext>(Lifestyle.Scoped);
            container.Register <IGenericRepository <ErrorReportApplication>, GenericRepository <ErrorReportApplication> >(Lifestyle.Scoped);
            container.Register <IGenericRepository <ErrorReportException>, GenericRepository <ErrorReportException> >(Lifestyle.Scoped);
            container.Register <ErrorsReportingService>(Lifestyle.Scoped);
            container.Verify();
        }
 public DBaseGenericRepositoryTest()
 {
     this.dataSet = new PersistentErrorsReportingDataSet();
 }