Module:Weapon/testcases

From Granblue Fantasy Wiki
Jump to navigation Jump to search

Documentation for this module may be created at Module:Weapon/testcases/doc

local weapon = require('Module:Weapon') -- the module to be tested
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()

function suite:test_renderObtain()
	self:assertEquals('[[Xeno Vohu Manah Clash]]', weapon._renderObtain{obtain='event,xeno,Xeno Vohu Manah Clash', obtain_text='[[Xeno Vohu Manah Clash]]'})
	self:assertEquals('[[Xeno Vohu Manah Clash]]', weapon._renderObtain{obtain='event,xeno,Xeno Vohu Manah Clash', obtain_text=''})
	self:assertEquals('[[Xeno Vohu Manah Clash]]', weapon._renderObtain{obtain='', obtain_text='[[Xeno Vohu Manah Clash]]'})
	self:assertEquals('[[Premium Draw]]<br />[[Surprise Ticket]]', weapon._renderObtain{obtain='premium,normal'})
	self:assertEquals('[[Premium Gala]]', weapon._renderObtain{obtain='premium,gala,normal'})
	self:assertEquals('[[Flash Gala]]', weapon._renderObtain{obtain='premium,gala,flash'})
	self:assertEquals('[[Valentine Premium Draw]]', weapon._renderObtain{obtain='premium,valentine'})
	self:assertEquals('[[Summer Premium Draw]]', weapon._renderObtain{obtain='premium,summer'})
	self:assertEquals('[[Halloween Premium Draw]]', weapon._renderObtain{obtain='premium,halloween'})
	self:assertEquals('[[Holiday Premium Draw]]', weapon._renderObtain{obtain='premium,holiday'})
	self:assertEquals('[[Premium Gala]] (2016 Zodiac Weapon)', weapon._renderObtain{obtain='premium,zodiac,2016'})
	self:assertEquals('[[Holiday Draw Set]]', weapon._renderObtain{obtain='premium,special,Holiday Draw Set'})
	self:assertEquals('[[Premium Draw|Holiday Draw Set]]', weapon._renderObtain{obtain='premium,special,[[Premium Draw|Holiday Draw Set]]'})
	self:assertEquals('[[Rise of the Beasts]]', weapon._renderObtain{obtain='event,rotb'})
	self:assertEquals('[[,,,break,,EVERY|THING,,,]]', weapon._renderObtain{obtain='event,rotb,[[,,,break,,EVERY|THING,,,]]'})
	self:assertEquals('{{itm|Gold Moon,3000}}', weapon._renderObtain{obtain='shop,trade moons,gold,3000'})
	self:assertEquals('{{itm|Silver Moon,??}}', weapon._renderObtain{obtain='shop,trade moons,silver'})
	self:assertEquals('{{itm|Bronze Moon,13}}', weapon._renderObtain{obtain='shop,trade moons,bronze,13'})
end

return suite