public ActionResult GetSummaryData(string symbol) { try { SummaryBusiness summaryBusiness = new SummaryBusiness(); List <SummaryData> summaryDatas = summaryBusiness.GetSummaryData(symbol); var jsonObject = new { code = 1, len = summaryDatas.Count, data = summaryDatas }; return(Json(jsonObject)); } catch (Exception e) { var jsonObject = new { code = 0, len = 0, data = new List <SummaryData>() }; return(Json(jsonObject)); } }
public void TestGetSummaryData() { string symbol = "a"; SummaryBusiness summaryBusiness = new SummaryBusiness(); try { List <SummaryData> summaryDatas = summaryBusiness.GetSummaryData(symbol); Assert.IsTrue(summaryDatas.Count > 0); } catch (Exception ex) { //Assert.IsInstanceOfType(ex, typeof(DemoException)); } }