Ejemplo n.º 1
0
        public SqlServerStoreFacts()
        {
            var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                          "\\RequestReduce.SampleWeb\\App_Data";

            if (Directory.Exists(dataDir))
            {
                File.Delete(dataDir + "\\RequestReduce.sdf");
            }
            else
            {
                Directory.CreateDirectory(dataDir);
            }

            RequestReduceDB.DefaultProviderName = "System.Data.SQLite";
            var mockConfig = new Mock <IRRConfiguration>();

            mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf;Version=3;");
            config = mockConfig.Object;
            repo   = new FileRepository(config);
            IntegrationFactHelper.RecyclePool();
            repo.GetDatabase().Execute(SqliteHelper.GetSqlLightSafeSql());
            rrFolder   = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore, 3000);
            uriBuilder = new UriBuilder(config);
        }
        public SqlServerStoreFacts()
        {
            var dataDir = Directory.GetParent(Directory.GetCurrentDirectory()).Parent.Parent.FullName +
                          "\\RequestReduce.SampleWeb\\App_Data";

            if (!Directory.Exists(dataDir))
            {
                Directory.CreateDirectory(dataDir);
            }
            Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
            var mockConfig = new Mock <IRRConfiguration>();

            mockConfig.Setup(x => x.ConnectionStringName).Returns("data source=" + dataDir + "\\RequestReduce.sdf");
            config = mockConfig.Object;
            repo   = new FileRepository(config);
            IntegrationFactHelper.RecyclePool();
            repo.Context.Database.Delete();
            repo.Context.Database.Create();
            rrFolder   = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.SqlServerStore, 3000);
            uriBuilder = new UriBuilder(config);
        }
Ejemplo n.º 3
0
 public ModuleFacts()
 {
     rrFolder   = IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.LocalDiskStore, Timeout.Infinite);
     uriBuilder = new UriBuilder(new Mock <IRRConfiguration>().Object);
 }
 public void Dispose()
 {
     IntegrationFactHelper.ResetPhysicalContentDirectoryAndConfigureStore(Configuration.Store.LocalDiskStore, Timeout.Infinite);
 }