コード例 #1
0
        public void entity_framework_context_from_business_layer_returns_on_testdb()
        {
            TestDatabaseEnsurer tester   = new TestDatabaseEnsurer();
            BaseDBAccess        dbAccess = new BaseDBAccess();

            Assert.That(tester.IsConnStringPointingToTestDB(dbAccess.Database.Database.Connection.ConnectionString), Is.True);
            Assert.That(tester.IsOnTestDB(), Is.True);
        }
コード例 #2
0
        public void base_setup()
        {
            TestDatabaseEnsurer insurance = new TestDatabaseEnsurer();

            Assert.That(insurance.IsOnTestDB(), Is.True);

            DatabaseReset reset = new DatabaseReset();

            reset.Reset();
        }
コード例 #3
0
        public void Reset()
        {
            Data.KeyCdrDataEntities db = new Data.KeyCdrDataEntities();

            TestDatabaseEnsurer ensurer = new TestDatabaseEnsurer();

            if (!ensurer.IsEntityFrameworkPointingToTest(db))
            {
                throw new Exception("not configured or pointing to the test environment...yikes!");
            }

            db.Database.ExecuteSqlCommand(GetClearCmd("KCUserLogin"));
            db.Database.ExecuteSqlCommand(GetClearCmd("AnalysisAccuracy"));
            db.Database.ExecuteSqlCommand(GetClearCmd("AnalysisSpeed"));
            db.Database.ExecuteSqlCommand(GetClearCmd("KeySequenceAnalysis"));
            db.Database.ExecuteSqlCommand(GetClearCmd("KeySequence"));
            db.Database.ExecuteSqlCommand(GetClearCmd("Session"));
            db.Database.ExecuteSqlCommand(GetClearCmd("KCUser"));
        }
コード例 #4
0
        public void test_db_correct_db_name_wrong_username(bool isTestDBConnString, string conn)
        {
            TestDatabaseEnsurer tester = new TestDatabaseEnsurer();

            Assert.That(tester.IsConnStringPointingToTestDB(conn), Is.EqualTo(isTestDBConnString));
        }
コード例 #5
0
        public void actual_test_db_detects_test(bool isTestDBConnString, string conn)
        {
            TestDatabaseEnsurer tester = new TestDatabaseEnsurer();

            Assert.That(tester.IsConnStringPointingToTestDB(conn), Is.EqualTo(isTestDBConnString));
        }