Add: HistoryRecordManager
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
let historyRecordManager = new HistoryRecordManager();
|
||||
|
||||
historyRecordManager.push(new HistoryRecordData("05/10", 1000));
|
||||
historyRecordManager.push(new HistoryRecordData("05/11", 100));
|
||||
historyRecordManager.push(new HistoryRecordData("05/12", 200));
|
||||
historyRecordManager.push(new HistoryRecordData("05/13", 2000));
|
||||
historyRecordManager.push(new HistoryRecordData("05/14", 10000));
|
||||
|
||||
QUnit.test( "push", function( assert ) {
|
||||
assert.equal(historyRecordManager.count, 5);
|
||||
});
|
||||
|
||||
QUnit.test( "getAt", function( assert ) {
|
||||
assert.equal(historyRecordManager.getDateAt(0), "05/10");
|
||||
assert.equal(historyRecordManager.getDateAt(4), "05/14");
|
||||
});
|
||||
|
||||
QUnit.test( "clear", function( assert ) {
|
||||
let historyRecordManagerForClear = new HistoryRecordManager();
|
||||
historyRecordManagerForClear.push(new HistoryRecordData("05/10", 1));
|
||||
historyRecordManagerForClear.clear();
|
||||
|
||||
assert.equal(historyRecordManagerForClear.count, 0);
|
||||
});
|
||||
|
||||
QUnit.test( "underValueForGraph", function( assert ) {
|
||||
assert.equal(historyRecordManager.underValueForGraph(), 100);
|
||||
});
|
||||
|
||||
QUnit.test( "upperValueForGraph", function( assert ) {
|
||||
assert.equal(historyRecordManager.upperValueForGraph(), 10000);
|
||||
});
|
||||
Reference in New Issue
Block a user