Module:Stock tickers/NYSE/testcases: Difference between revisions
Appearance
Content deleted Content added
Svgalbertian (talk | contribs) another example |
Svgalbertian (talk | contribs) add tests cases for different exchanges |
||
Line 5: | Line 5: | ||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | PRE.PRD}}', 'http://www.nyse.com/quote/XNYS:PREpD') |
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | PRE.PRD}}', 'http://www.nyse.com/quote/XNYS:PREpD') |
||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | BCS.PR}}', 'http://www.nyse.com/quote/XNYS:BCSp') |
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | BCS.PR}}', 'http://www.nyse.com/quote/XNYS:BCSp') |
||
end |
|||
function p:test_exchanges() |
|||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | GE }}', 'http://www.nyse.com/quote/XNYS:GE') |
|||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | GE | exchange=NYSE}}', 'http://www.nyse.com/quote/XNYS:GE') |
|||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | BTI | exchange=AMEX}}', 'http://www.nyse.com/quote/XASE:BTI') |
|||
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | SPY | exchange=ARCA}}', 'http://www.nyse.com/quote/ARCX:SPY') |
|||
end |
end |
||
Revision as of 13:51, 3 August 2014
![]() | This is the test cases page for the module Module:Stock tickers/NYSE. Results of the test cases. |
-- Example Unit tests for [[Module:Stock tickers/NYSE]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_preferred_shares()
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | PRE.PRD}}', 'http://www.nyse.com/quote/XNYS:PREpD')
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | BCS.PR}}', 'http://www.nyse.com/quote/XNYS:BCSp')
end
function p:test_exchanges()
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | GE }}', 'http://www.nyse.com/quote/XNYS:GE')
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | GE | exchange=NYSE}}', 'http://www.nyse.com/quote/XNYS:GE')
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | BTI | exchange=AMEX}}', 'http://www.nyse.com/quote/XASE:BTI')
self:preprocess_equals('{{#invoke:Stock tickers/NYSE | GetURL | SPY | exchange=ARCA}}', 'http://www.nyse.com/quote/ARCX:SPY')
end
return p