public void DropDB() { SQLParser par = new SQLParser(); DropDB sbres = (DropDB)par.Parser("DROP DATABASE db1;"); DropDB sel = new DropDB("db1"); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getDB(), sel.getDB()); }
public void DropTable() { SQLParser par = new SQLParser(); DropTable sbres = (DropTable)par.Parser("DROP TABLE table1;"); DropTable sel = new DropTable("table1"); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }
public void BackUp() { SQLParser par = new SQLParser(); BackUp sbres = (BackUp)par.Parser("BACKUP DATABASE database TO DISK = 'filepath';"); BackUp backup = new BackUp("database", "filepath"); Assert.AreEqual(sbres.GetType(), backup.GetType()); Assert.AreEqual(sbres.getDB(), backup.getDB()); }
public void Insert() { SQLParser par = new SQLParser(); Insert sbres = (Insert)par.Parser("INSERT INTO table VALUES (value1);"); Insert sel = new Insert("table", null, null); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }
public void Select() { SQLParser par = new SQLParser(); Select sbres = (Select)par.Parser("SELECT * FROM table1;"); string[] a = new string[2]; a[0] = "*"; Select sel = new Select("table1", a, null); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }
public void Delete() { SQLParser par = new SQLParser(); Delete sbres = (Delete)par.Parser("DELETE FROM table1 WHERE 1=1;"); string[] a = new string[2]; a[0] = "1=1"; Delete sel = new Delete("table1", a); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }
public void Update() { SQLParser par = new SQLParser(); Update sbres = (Update)par.Parser("UPDATE table SET column1=value1 WHERE 1=1;"); string[] a = new string[2]; a[0] = "*"; Update sel = new Update("table", a, null); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }
public void CreateTable() { SQLParser par = new SQLParser(); CreateTable sbres = (CreateTable)par.Parser("CREATE TABLE tabla1 (edad INT);"); string[] a = new string[2]; a[0] = "edad"; CreateTable sel = new CreateTable("tabla1", a); Assert.AreEqual(sbres.GetType(), sel.GetType()); Assert.AreEqual(sbres.getTabla(), sel.getTabla()); }