public void ShouldInsertOneRow_async() { int idE = 104; DynamicParameters dynamicParameters0 = new DynamicParameters(); dynamicParameters0.Add("@paramId", idE, DbType.Int32); dynamicParameters0.Add("@paramName", "insert", DbType.AnsiStringFixedLength); TableScripts tableScripts = new TableScripts() { ScriptName = "insert", NameTable = "employee", Script = "insert into employee ([employee_id],[employee_name]) values (@paramId,@paramName)", paramters = dynamicParameters0 }; SQuerySelected.GenerateScripts(tableScripts.ScriptName, tableScripts.NameTable, tableScripts.Script, tableScripts.paramters); Task.Run(async() => { await execNonQuery.ASync_ExecuteNonQuey(tableScripts, dbType.mssql); // Actual test code here. }).GetAwaiter().GetResult(); var resultQuery = SQuerySelected.GetScritps; var query = resultQuery.Where(x => x.ScriptName == "GetAllEmployees").First(); var result = getDataFromDB.Sync_GetDataFromTable_Return_T(query, dbType.mssql); int id = result.OrderByDescending(x => x.employee_id).FirstOrDefault().employee_id; Assert.AreEqual(idE, id); }
public void RunScript() { WebDriverWait OBJ = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); OBJ.Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(By.Id("_externalPage"))); VisibilityOfAllElementsLocatedBy(By.Id("fil_itemListFUI"), 10); IList <IWebElement> all = TableScripts.FindElements(By.TagName("tr")); IList <IWebElement> all1 = all[3].FindElements(By.TagName("td")); IList <IWebElement> all2 = all1[5].FindElements(By.TagName("a")); all2[0].Click(); }
public static TableScripts SqlLiteDBDeleteReservation(int reservation_id) { TableScripts tableInsertScripts; tableInsertScripts = new TableScripts { nameTable = @"\reservation.db", script = @"DELETE FROM reservation WHERE reservation_id=" + reservation_id.ToString(), operationType = OperationType.delete, connectionProperties = new Microsoft.Data.Sqlite.SqliteConnection(@"DataSource=" + GetPathDBFile() + @"\reservation.db") }; return(tableInsertScripts); }
public static TableScripts SqlLiteDBUpdateEmployee(Employee model, int employee_id) { TableScripts tableInsertScripts; tableInsertScripts = new TableScripts { nameTable = @"\employee.db", script = @"update Employee " + " set " + " employee_name= " + "'" + model.employee_name + "'," + " where employee_id=" + employee_id.ToString(), operationType = OperationType.update, connectionProperties = new Microsoft.Data.Sqlite.SqliteConnection(@"DataSource=" + GetPathDBFile() + @"\employee.db") }; return(tableInsertScripts); }
public static TableScripts SqlLiteDBUpdateServices(Services model, int services_id) { TableScripts tableInsertScripts; tableInsertScripts = new TableScripts { nameTable = @"\services.db", script = @"update Services " + " set " + " services_name= " + "'" + model.services_name + "'," + " where services_id=" + services_id.ToString(), operationType = OperationType.update, connectionProperties = new Microsoft.Data.Sqlite.SqliteConnection(@"DataSource=" + GetPathDBFile() + @"\services.db") }; return(tableInsertScripts); }
public static TableScripts SqlLiteDBUpdateClient(Client model, int client_id) { TableScripts tableInsertScripts; tableInsertScripts = new TableScripts { nameTable = @"\client.db", script = @"update Client " + " set " + " client_name= " + "'" + model.client_name + "'," + " client_sname= " + "'" + model.client_sname + "'," + " client_phone= " + "'" + model.client_phone + "'," + " client_description= " + "'" + model.client_description + "'" + " where client_id=" + client_id.ToString(), operationType = OperationType.update, connectionProperties = new Microsoft.Data.Sqlite.SqliteConnection(@"DataSource=" + GetPathDBFile() + @"\client.db") }; return(tableInsertScripts); }
public static TableScripts SqlLiteDBUpdateReservation(Reservation model, int reservation_id) { TableScripts tableInsertScripts; tableInsertScripts = new TableScripts { nameTable = @"\reservation.db", script = @"update Reservation " + " set " + " reservation_date= " + "'" + model.reservation_date + "'," + " reservation_time= " + "'" + model.reservation_time + "'," + " client_id= " + "'" + model.client_id + "'," + " services_id= " + "'" + model.services_id + "'," + " employee_id= " + "'" + model.employee_id + "'" + " where reservation_id=" + reservation_id.ToString(), operationType = OperationType.update, connectionProperties = new Microsoft.Data.Sqlite.SqliteConnection(@"DataSource=" + GetPathDBFile() + @"\reservation.db") }; return(tableInsertScripts); }
public List <ModelEmployee> GetEmployees_sync_param_TableScripts(TableScripts tableScript, dbType db_type) { return(sQLDataAccessQuery.loadData_sync <ModelEmployee, dynamic>(tableScript.Script, tableScript.paramters, db_type)); }
public List <T> Sync_GetDataFromTable_Return_T(TableScripts tableScript, dbType db_type) { return(getDataFromDB.loadData_sync <T, dynamic>(tableScript.Script, tableScript.paramters, db_type)); }
public void Sync_ExecuteNonQuery(TableScripts tableScript, dbType db_type) { createCommnad.Sync_SaveData <T, dynamic>(tableScript.Script, tableScript.paramters, db_type); }
public async Task ASync_ExecuteNonQuey(TableScripts tableScript, dbType db_type) { await createCommnad.Async_SaveData <T, dynamic>(tableScript.Script, tableScript.paramters, db_type); }