public void Test_ReadFromMemory(string testInput, int count) { var reader = testInput.GetStreamReader(); _service.UploadZteAlarms(reader); Assert.AreEqual(_service.GetAlarmsToBeDump(), count); }
public ActionResult ZteAlarmPost(HttpPostedFileBase[] alarmZte) { if (alarmZte == null || alarmZte.Length <= 0 || string.IsNullOrEmpty(alarmZte[0]?.FileName)) { return(View("AlarmImport")); } ViewBag.Message = "共上传中兴告警信息文件" + alarmZte.Length + "个!"; foreach (var file in alarmZte) { _alarmsService.UploadZteAlarms(new StreamReader(file.InputStream, Encoding.GetEncoding("GB2312"))); } return(View("AlarmImport")); }