public void GetFunctionByFilterTest() { FunctionBusiness target = new FunctionBusiness(); // 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_FUNCTIONAL> expected = null; // TODO: Initialize to an appropriate value List <MA_FUNCTIONAL> actual; actual = target.GetFunctionByFilter(sessioninfo, name, startIndex, count, sorting); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public static object GetFunctionByFilter(SessionInfo sessioninfo, string code, int jtStartIndex, int jtPageSize, string jtSorting) { try { //Return result to jTable FunctionBusiness _functionBusiness = new FunctionBusiness(); //Get data from database List <MA_FUNCTIONAL> function = _functionBusiness.GetFunctionByFilter(sessioninfo, code, jtSorting); //Return result to jTable return(new { Result = "OK" , Records = jtPageSize > 0 ? function.Skip(jtStartIndex).Take(jtPageSize).ToList() : function , TotalRecordCount = function.Count }); } catch (BusinessWorkflowsException bex) { return(new { Result = "ERROR", Message = bex.Message }); } catch (Exception ex) { return(new { Result = "ERROR", Message = ex.Message }); } }