public async Task <JsonResult> GeoReport(string keyword = null, DateTime?startDate = null, DateTime?endDate = null) { GeoReportViewModel geo = new GeoReportViewModel(false); await geo.GetGeoReport(true, keyword, startDate, endDate); return(Json(geo, JsonRequestBehavior.AllowGet)); }
public async void GeoReport() { var controller = new ReportController(); var result = await controller.GeoReport(); GeoReportViewModel geo = null; try { geo = (GeoReportViewModel)result.Data; } catch (Exception ex) { throw new Exception("GeoReportViewModel failed to parse: " + ex.Message); } Assert.NotNull(geo); Assert.AreEqual(String.Empty, geo.ErrorMsg); Assert.AreEqual(50, geo.data.Count); }