コード例 #1
0
 public override void ResetStateOfSut()
 {
     DbCleaner.ClearDatabase_Postgres(_connection, null,
                                      new List <string> {
         "Mammals"
     });
 }
コード例 #2
0
        public async Task DisposeAsync()
        {
            DbCleaner.ClearDatabase(_connection, null, DatabaseType.MYSQL, "db");

            await _connection.CloseAsync();

            await mySql.StopAsync();
        }
コード例 #3
0
        public async Task DisposeAsync()
        {
            DbCleaner.ClearDatabase(_connection, null, GetDbType(), "");

            await _connection.CloseAsync();

            await _msSql.StopAsync();
        }
コード例 #4
0
ファイル: SetUpFixture.cs プロジェクト: gitcomteam/gitcom-api
 public void AfterAllTests()
 {
     try {
         DbConnection.RollbackTransaction();
     }
     catch (Exception e) {
         // ignored
     }
     DbCleaner.TruncateAll();
 }
コード例 #5
0
 public MenuFileExecutor(KeeperDb db, MySettings mySettings,
                         DbCleaner dbCleaner, DbBackuper dbBackuper, IDbToTxtSaver dbToTxtSaver, IDbFromTxtLoader dbFromTxtLoader)
 {
     _db              = db;
     _mySettings      = mySettings;
     _dbCleaner       = dbCleaner;
     _dbBackuper      = dbBackuper;
     _dbToTxtSaver    = dbToTxtSaver;
     _dbFromTxtLoader = dbFromTxtLoader;
 }
コード例 #6
0
        static void Main(string[] args)
        {
            // Start!
            var timer   = Stopwatch.StartNew();
            var runMain = true;

            foreach (var arg in args)
            {
                if (arg == "test")
                {
                    runMain = false;
                    var cleaner = new DbCleaner();
                    cleaner.showSomeTests();
                }
                else if (arg == "cleandb")
                {
                    runMain = false;
                    var cleaner = new DbCleaner();
                    cleaner.CleanDb();
                }

                if (arg == "all")
                {
                    _overWriteMax = 4900000;
                    SeedStore.GenerateSQLFiles = true;
                }

                if (arg == "nocopy")
                {
                    _copyToOutputLocation = false;
                }

                if (arg == "temp")
                {
                    runMain = false;
                    var temp = new Temp();
                    temp.DoSomething();
                }
            }

            if (runMain)
            {
                MainRun();
            }

            timer.Stop();
            TimeSpan timespan = timer.Elapsed;

            Console.WriteLine("Completed! took " + String.Format("{0:00}:{1:00}:{2:00}", timespan.Minutes, timespan.Seconds, timespan.Milliseconds / 10));
        }
コード例 #7
0
        /// <summary>
        /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        /// </summary>
        /// <param name="app"></param>
        /// <param name="env"></param>
        /// <param name="loggerFactory"></param>
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            // // global policy - assign here or on each controller
            // app.UseCors("CorsPolicy");

            ConfigureToken(app);

            app.UseMvc();

            //Remove invalidated tokens from Db
            DbCleaner.RemoveInvalidatedTokens(app.ApplicationServices, new JWTAuthTokenServices());

            //Seed db with initial data
            DbSeeder.SeedDbWithSampleUsers(app.ApplicationServices);
        }
コード例 #8
0
 public void SetUp() => DbCleaner.TruncateAll();
コード例 #9
0
ファイル: SetUpFixture.cs プロジェクト: gitcomteam/gitcom-api
 public void BeforeAllTests()
 {
     DbCleaner.TruncateAll();
 }
コード例 #10
0
 protected override void CleanDb(List <string> tablesToSkip)
 {
     DbCleaner.ClearDatabase(_connection, tablesToSkip, GetDbType());
 }
コード例 #11
0
 public void BeforeEachTest()
 {
     JobsPool.Get().CleanUp();
     DbCleaner.TruncateAll();
 }