插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.0 KiB

5 years ago
package com.fanruan.api.data;
import com.fanruan.api.Prepare;
5 years ago
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.file.TableDataConfig;
import com.fr.main.impl.WorkBook;
import com.fr.script.Calculator;
import org.junit.Assert;
5 years ago
import org.junit.Test;
/**
* @author richie
* @version 10.0
* Created by richie on 2019-08-15
*/
public class TableDataKitTest extends Prepare {
@Test
public void getTableData() {
5 years ago
TestTD td = new TestTD();
5 years ago
TableDataConfig.getInstance().addTableData("first", td);
5 years ago
Calculator calculator = Calculator.createCalculator();
calculator.setAttribute(TableDataSource.KEY, new WorkBook());
5 years ago
TableData r = TableDataKit.getTableData(calculator, "first");
Assert.assertEquals(td, r);
5 years ago
}
@Test
public void testGetTableData() {
5 years ago
TestTD td = new TestTD();
5 years ago
WorkBook workBook = new WorkBook();
5 years ago
workBook.putTableData("test", td);
5 years ago
TableData r = TableDataKit.getTableData(workBook, "test");
5 years ago
Assert.assertEquals(td, r);
5 years ago
}
5 years ago
5 years ago
}