Module:Arrowverse redirect category handler/testcases

-- Unit tests for [[Module:Arrowverse redirect category handler]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_01_testSeriesName()
	self:preprocess_equals_sandbox_many('{{#invoke:Arrowverse redirect category handler', 'testSeriesName', {
		{"", "Arrowverse" },
		{"arrow=yes", "Arrow (TV series)"},
		{"flash=yes", "The Flash (2014 TV series)"},
		{"constantine=yes", "Constantine (TV series)"},
		{"legends=yes", "Legends of Tomorrow"},
		{"supergirl=yes", "Supergirl (TV series)"},
		{"vixen=yes", "Vixen (web series)"},
		{"ray=yes", "Freedom Fighters: The Ray"},
		{"batwoman=yes", "Batwoman (TV series)"},
		{"black_lightning=yes", "Black Lightning (TV series)"},
	})
end

function p:test_02_getSeriesList()
	self:preprocess_equals_sandbox_many('{{#invoke:Arrowverse redirect category handler', 'getSeriesList', {
		{"", "table"},
	})
end

function p:test_03_getFranchiseName()
	self:preprocess_equals_sandbox_many('{{#invoke:Arrowverse redirect category handler', 'getFranchiseName', {
		{"", "Arrowverse"},
	})
end

function p:test_04_redirect_categories()
	self:preprocess_equals_sandbox_many('{{#invoke:Arrowverse redirect category handler', 'character|test=yes', {
		{"", "R from fictional character, R to section, R with possibilities, R printworthy"},
		{"arrow=yes|flash=yes", "Arrow (TV series), The Flash (2014 TV series), Arrowverse, R from fictional character, R to section, R with possibilities, R printworthy"},
	})
end

return p