Module:Creator/testcases
Appearance
This is the test cases page for the module Module:Creator. Results of the test cases. |
local p = require('Module:UnitTests')
local Creator = require('Module:Creator')
local TESTDATA = {
Shakespeare = {
id = 'Q692',
wsPage = 'Author:William Shakespeare (1564-1616)',
label = 'William Shakespeare',
--type = Creator.TYPES.PERSON,
birthYear = '1564',
deathYear = '1616'
}
}
function p:doTest( testCaseName )
local data = TESTDATA[ testCaseName ]
local w = Creator.newCreator( data.id )
-- check sitelink
self:equals(testCaseName .. ': WS Page', w.wsPage, data.wsPage )
-- check label
self:equals(testCaseName .. ': Label', w.label, data.label )
end
function p:test_shakespeare()
self:doTest( 'Shakespeare' )
end
return p