public static void DropAll() { if (test == true) { Pessoa.Drop(); Fisioterapeuta.Drop(); Paciente.Drop(); Musculo.Drop(); Movimento.Drop(); Sessao.Drop(); Exercicio.Drop(); MovimentoMusculo.Drop(); PontosRotuloPaciente.Drop(); PontosRotuloFisioterapeuta.Drop(); } }
public static void TestDropMovement() { using (var conn = new SqliteConnection(GlobalController.path)) { conn.Open(); Movimento.Drop(); var check = "SELECT count(*) FROM sqlite_master WHERE type='table' AND name='MOVIMENTO';"; var result = 0; using (var cmd = new SqliteCommand(check, conn)) { using (IDataReader reader = cmd.ExecuteReader()) { try { while (reader.Read()) { if (!reader.IsDBNull(0)) { result = reader.GetInt32(0); } } } finally { reader.Dispose(); reader.Close(); } } cmd.Dispose(); } Assert.AreEqual(result, 0); conn.Dispose(); conn.Close(); } }