Exemplo n.º 1
0
        public LoggingTest()
        {
            IoCConfiguration.Setup(true);

            this.connection          = new SqlConnection(DatabaseConfiguration.ErrorsReportingConnectionString);
            this.exceptionsSqlHelper = new ExceptionsSqlHelper(this.connection);
        }
Exemplo n.º 2
0
        public ErrorsLoggingTest()
        {
            Configuration.InversionOfControl.Initialize(); // dirty trick

            this.connection          = new SqlConnection(DatabaseConfiguration.ErrorsReportingConnectionString);
            this.exceptionsSqlHelper = new ExceptionsSqlHelper(this.connection);
        }
        public PersistentErrorsReportingDataSet()
        {
            this.ApplicationsIds = new List <int>();
            this.ExceptionsIds   = new List <int>();

            this.connection = new SqlConnection(DatabaseConfiguration.ErrorsReportingConnectionString);
            this.connection.Open();

            this.applications = new ApplicationsSqlHelper(this.connection);
            this.exceptions   = new ExceptionsSqlHelper(this.connection);
        }
Exemplo n.º 4
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.º 5
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();
        }