public static object GetInstrumentOptions(SessionInfo sessioninfo) { try { InstrumentBusiness _instrumentBusiness = new InstrumentBusiness(); //Get data from database var instruments = _instrumentBusiness.GetInstrumentAll() .Where(t => t.ISACTIVE == true) .OrderBy(p => p.LABEL) .Select(c => new { DisplayText = c.LABEL, Value = c.ID }); //Return result to jTable return new { Result = "OK", Options = instruments }; } catch (Exception ex) { return new { Result = "ERROR", Message = ex.Message }; } }
public void GetInstrumentAllTest() { InstrumentBusiness target = new InstrumentBusiness(); // TODO: Initialize to an appropriate value List<MA_INSTRUMENT> expected = null; // TODO: Initialize to an appropriate value List<MA_INSTRUMENT> actual; actual = target.GetInstrumentAll(); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }