//xls和xlsx测试
 public void ExcelControllerVersionTest()
 {
     ExcelDataController EDC = new ExcelDataController();
     List<DealListEntity> DLEL;
     Assert.AreEqual(OPENEXCEL_ERROR.FORMAT_ERROR, EDC.Open(Environment.CurrentDirectory + "//TestExcel//股票数据.xlsx", out DLEL));
     Assert.AreEqual(OPENEXCEL_ERROR.FORMAT_ERROR, EDC.Open(Environment.CurrentDirectory + "//TestExcel//股票数据.xls", out DLEL));
 }
 //读取数据测试
 public void ExcelControllerDataTest()
 {
     ExcelDataController EDC = new ExcelDataController();
     List<DealListEntity> DLEL;
     EDC.Open(Environment.CurrentDirectory + "//TestExcel//股票数据.xlsx", out DLEL);
     Assert.AreNotEqual(0, DLEL.Count);
     Assert.AreEqual("伊利股份", DLEL[0].name);
     Assert.AreEqual("600887", DLEL[0].id);
 }
Beispiel #3
0
 private List<DealListEntity> OpenExcel(string str)
 {
     ExcelDataController edc = new ExcelDataController();
     List<DealListEntity> DLEL;
     Adapter.ErrorAdapter.Show(edc.Open(str, out DLEL));
     return DLEL;
 }