public void table_should_return_pk_reference_error(DataTablePayload db) { var response = callCreateTable(db); Assert.NotNull(response.Value); Assert.Equal("Primary key can not be reference attribute.", response.Value.message); }
public void table_should_return_pk_not_found(DataTablePayload db) { var response = callCreateTable(db); Assert.NotNull(response.Value); Assert.Equal("Invalid number of primary key", response.Value.message); }
public void table_should_return_quantity_error(DataTablePayload db) { var response = callCreateTable(db); Assert.NotNull(response.Value); Assert.Equal("Database must have at least 2 attributes.", response.Value.message); }
public void table_should_return_db_not_found(DataTablePayload db) { var response = callCreateTable(db); Assert.NotNull(response.Value); Assert.Equal($"Database {db.databaseKey} not found.", response.Value.message); }
public ActionResult <APIResponse <TableViewModel> > table(DataTablePayload payload) { return(base.BeginCommonHandler <TableViewModel>(response => { response.content = _mapper.Map <TableViewModel>(_databaseService.createTable(payload.databaseKey, payload.tableName , _mapper.Map <List <TableAttribute> >(payload.attributes))); })); }
public DataTablePayload <T> GetDataTablePayload <T>() { var payload = new DataTablePayload <T>(); payload.Draw = HttpContext.Request.Form["draw"].FirstOrDefault(); // Skip number of Rows count payload.Skip = Request.Form["start"].FirstOrDefault() != null?Convert.ToInt32(Request.Form["start"].FirstOrDefault()) : 0; // Paging Length 10,20 payload.PageSize = Request.Form["length"].FirstOrDefault() != null?Convert.ToInt32(Request.Form["length"].FirstOrDefault()) : 0; // Sort Column Name payload.SortColumn = Request.Form["columns[" + Request.Form["order[0][column]"].FirstOrDefault() + "][name]"].FirstOrDefault(); // Sort Column Direction (asc, desc) payload.SortColumnDirection = Request.Form["order[0][dir]"].FirstOrDefault(); // Search Value from (Search box) payload.SearchValue = Request.Form["search[value]"].FirstOrDefault(); return(payload); }
private ActionResult <APIResponse <TableViewModel> > callCreateTable(DataTablePayload payload) { return(this._controller.table(payload)); }