Dota 2 Вики
Advertisement

Для документации этого модуля может быть создана страница Модуль:Ability icon/testcases/doc

local aicon = require('Модуль: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='Ускорение', source='Руна ускорения'}))
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
Advertisement