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); }
public void base_setup() { TestDatabaseEnsurer insurance = new TestDatabaseEnsurer(); Assert.That(insurance.IsOnTestDB(), Is.True); DatabaseReset reset = new DatabaseReset(); reset.Reset(); }
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")); }
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)); }
public void actual_test_db_detects_test(bool isTestDBConnString, string conn) { TestDatabaseEnsurer tester = new TestDatabaseEnsurer(); Assert.That(tester.IsConnStringPointingToTestDB(conn), Is.EqualTo(isTestDBConnString)); }