我有一个扩展private void addEntry() {
LineData data = mChart.getData();
LineDataSet set0 = (LineDataSet) data.getDataSetByIndex(0);
LineDataSet set1 = (LineDataSet) data.getDataSetByIndex(1);
if (set0 == null || set1 == null) {
// creation of null
set0 = createSet();
set1 = createSet();
data.addDataSet(set0);
data.addDataSet(set1);
}
data.addXValue("");
data.addEntry(new Entry((float) (Math.random() * 20) + 2f, set0.getEntryCount()), 0);
data.addEntry(new Entry((float) (Math.random() * 20) + 2f, set1.getEntryCount()), 1);
mChart.notifyDataSetChanged();
mChart.setVisibleXRangeMaximum(6);
mChart.moveViewToX(data.getXValCount() - 7);
}
特征的Scala对象。
例如
App
我如何对这个对象进行单元测试?