@gitchrisqueen/tdameritrade-api-js-client
Version:
TD Ameritrade API integration for node.js
136 lines (126 loc) • 5.13 kB
JavaScript
/*
* TD Ameritrade API - OAuth2
* This is replication of the TD Ameritrade API.
*
* OpenAPI spec version: 0.1.4
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.14
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD.
define(['expect.js', '../../src/index'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
factory(require('expect.js'), require('../../src/index'));
} else {
// Browser globals (root is window)
factory(root.expect, root.GitChrisQueen_TDA_JS);
}
}(this, function(expect, GitChrisQueen_TDA_JS) {
'use strict';
var instance;
beforeEach(function() {
instance = new GitChrisQueen_TDA_JS.MarketHoursApi();
});
describe('(package)', function() {
describe('MarketHoursApi', function() {
describe('marketdataHoursGET', function() {
it('should call marketdataHoursGET successfully', function(done) {
// TODO: uncomment, update parameter values for marketdataHoursGET call and complete the assertions
/*
var opts = {};
opts.apiKey = "apiKey_example";
opts.markets = "markets_example";
opts._date = new Date("2013-10-20T19:20:30+01:00");
instance.marketdataHoursGET(opts).then(function(data) {
// TODO: update response assertions
expect(data).to.be.a(GitChrisQueen_TDA_JS.Hours);
expect(data.category).to.be.a('string');
expect(data.category).to.be("");
expect(data._date).to.be.a('string');
expect(data._date).to.be("");
expect(data.exchange).to.be.a('string');
expect(data.exchange).to.be("");
expect(data.isOpen).to.be.a('boolean');
expect(data.isOpen).to.be(false);
expect(data.marketType).to.be.a('string');
expect(data.marketType).to.be("BOND");
expect(data.product).to.be.a('string');
expect(data.product).to.be("");
expect(data.productName).to.be.a('string');
expect(data.productName).to.be("");
expect(data.sessionHours).to.be.a(GitChrisQueen_TDA_JS.HoursSessionHours);
{
let dataCtr = data.sessionHours.additionalProperties;
expect(dataCtr).to.be.an(Array);
expect(dataCtr).to.not.be.empty();
for (let p in dataCtr) {
let data = dataCtr[p];
expect(data).to.be.a('string');
expect(data).to.be("");
}
}
done();
}, function(error) {
done(error);
});
*/
// TODO: uncomment and complete method invocation above, then delete this line and the next:
done();
});
});
describe('marketdataMarketHoursGET', function() {
it('should call marketdataMarketHoursGET successfully', function(done) {
// TODO: uncomment, update parameter values for marketdataMarketHoursGET call and complete the assertions
/*
var market = "market_example";
var opts = {};
opts.apiKey = "apiKey_example";
opts._date = new Date("2013-10-20T19:20:30+01:00");
instance.marketdataMarketHoursGET(market, opts).then(function(data) {
// TODO: update response assertions
expect(data).to.be.a(GitChrisQueen_TDA_JS.Hours);
expect(data.category).to.be.a('string');
expect(data.category).to.be("");
expect(data._date).to.be.a('string');
expect(data._date).to.be("");
expect(data.exchange).to.be.a('string');
expect(data.exchange).to.be("");
expect(data.isOpen).to.be.a('boolean');
expect(data.isOpen).to.be(false);
expect(data.marketType).to.be.a('string');
expect(data.marketType).to.be("BOND");
expect(data.product).to.be.a('string');
expect(data.product).to.be("");
expect(data.productName).to.be.a('string');
expect(data.productName).to.be("");
expect(data.sessionHours).to.be.a(GitChrisQueen_TDA_JS.HoursSessionHours);
{
let dataCtr = data.sessionHours.additionalProperties;
expect(dataCtr).to.be.an(Array);
expect(dataCtr).to.not.be.empty();
for (let p in dataCtr) {
let data = dataCtr[p];
expect(data).to.be.a('string');
expect(data).to.be("");
}
}
done();
}, function(error) {
done(error);
});
*/
// TODO: uncomment and complete method invocation above, then delete this line and the next:
done();
});
});
});
});
}));