Commit 2166f298 by 钟明宏

'增加单元测试'

parent f6a94ae1
......@@ -3,10 +3,14 @@ package com.yunmaozj.excel.opus;
import cn.yunmaozj.tools.excel.core.DefaultExcelExport;
import cn.yunmaozj.tools.excel.core.DefaultExcelImport;
import com.yunmaozj.excel.model.OpusModel;
import org.apache.tools.ant.util.FileUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -70,6 +74,12 @@ public class DefaultExcelExportTest {
assertEquals(model.getLocation(), list.get(0).getLocation());
assertEquals(model.getLat(), list.get(0).getLat(), 1);
assertEquals(model.getLng(), list.get(0).getLng(), 1);
assertEquals(model.getCreateDate().getTime(), list.get(0).getCreateDate().getTime());
assertEquals(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(model.getCreateDate()),
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(list.get(0).getCreateDate()));
}
@After
public void deleteFile(){
FileUtils.delete(new File(excelFile));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment