public static object GetByFilter(SessionInfo sessioninfo, string name, int jtStartIndex, int jtPageSize, string jtSorting) { try { UserBusiness _userBusiness = new UserBusiness(); //Get data from database List<MA_USER> users = _userBusiness.GetByFilter(sessioninfo, name, jtSorting); //Return result to jTable return new { Result = "OK", Records = jtPageSize > 0 ? users.Skip(jtStartIndex).Take(jtPageSize).ToList() : users, TotalRecordCount = users.Count }; } catch (BusinessWorkflowsException bex) { return new { Result = "ERROR", Message = bex.Message }; } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } }
public void GetByFilterTest() { UserBusiness target = new UserBusiness(); // TODO: Initialize to an appropriate value SessionInfo sessioninfo = null; // TODO: Initialize to an appropriate value string name = string.Empty; // TODO: Initialize to an appropriate value int startIndex = 0; // TODO: Initialize to an appropriate value int count = 0; // TODO: Initialize to an appropriate value string sorting = string.Empty; // TODO: Initialize to an appropriate value List<MA_USER> expected = null; // TODO: Initialize to an appropriate value List<MA_USER> actual; actual = target.GetByFilter(sessioninfo, name, startIndex, count, sorting); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }