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.
27 lines
693 B
27 lines
693 B
var FakeHttpProvider = require('./FakeHttpProvider');
|
|
|
|
var FakeHttpProvider2 = function () {
|
|
this.counter = 0;
|
|
this.resultList = [];
|
|
};
|
|
|
|
FakeHttpProvider2.prototype = new FakeHttpProvider();
|
|
FakeHttpProvider2.prototype.constructor = FakeHttpProvider2;
|
|
|
|
FakeHttpProvider2.prototype.injectResultList = function (list) {
|
|
this.resultList = list;
|
|
};
|
|
|
|
FakeHttpProvider2.prototype.getResponse = function () {
|
|
var result = this.resultList[this.counter];
|
|
this.counter++;
|
|
if (result.type === 'batch') {
|
|
this.injectBatchResults(result.result);
|
|
} else {
|
|
this.injectResult(result.result);
|
|
}
|
|
return this.response;
|
|
};
|
|
|
|
module.exports = FakeHttpProvider2;
|
|
|
|
|