Module:Ability icon/testcases

local aicon = require('Module:Ability icon') -- the module to be tested local ScribuntoUnit = require('Module:ScribuntoUnit') local suite = ScribuntoUnit:new

-- Basic tests

function suite:testNormalAbility self:assertEquals('File:Tether icon.png', aicon.main({name='Tether', source='Io'})) end

function suite:testItemAbility self:assertEquals('File:Battle Fury icon.png', aicon.main({name='Cleave', source='Battle Fury'})) end

function suite:testRuneAbility self:assertEquals('File:Bottle (Haste) icon.png', aicon.main({name='Haste', source='Haste Rune'})) end

-- Test no name.

function suite:testItem self:assertEquals('File:Battle Fury icon.png', aicon.main({source='Battle Fury'})) end

-- Test given data

function suite:testGivenData local data = { type = 'hero', image = 'File:Not Tethers icon.png' }   self:assertEquals('File:Not Tethers icon.png', aicon._main({name='Tether', source='Io'}, data)) end

-- Test default icon

function suite:testDefault local data = { type = 'hero', image = '' }   self:assertEquals('File:Unknown icon.png', aicon._main({name='Tether', source='Io'}, data)) end

return suite