Jump to content

Module:Professional wrestling profiles/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Silverfish (talk | contribs) at 17:41, 30 June 2016. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Example Unit tests for [[Module:Professional wrestling]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_profiles_blank()
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles}}', '[[Category:Professional wrestling profiles template without any identifiers]]');
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena}}', '[[Category:Professional wrestling profiles template without any identifiers]]');
end

function p:test_profiles_single()
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|cagematch = 691}}', "Professional wrestling/testcases's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|cagematch = 691}}', "John Cena's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|wrestlingdata = 336}}', "Professional wrestling/testcases's profile at [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|wrestlingdata = 336}}', "John Cena's profile at [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|iwd = john-cena-350}}', "Professional wrestling/testcases's profile at [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|iwd = john-cena-350}}', "John Cena's profile at [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
end

function p:test_profiles_double()
	self:preprocess_equals('{{#invoke:Professional wrestling | profiles|cagematch = 691|wrestlingdata = 336}}', "Professional wrestling/testcases's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|cagematch = 691|wrestlingdata = 336}}', "John Cena's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|cagematch = 691|iwd =john-cena-350}}', "Professional wrestling/testcases's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|cagematch = 691|iwd =john-cena-350}}', "John Cena's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|wrestlingdata = 336|iwd =john-cena-350}}', "Professional wrestling/testcases's profile at [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|wrestlingdata = 336|iwd =john-cena-350}}', "John Cena's profile at [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
end

function p:test_profiles_triple()
	self:preprocess_equals('{{#invoke:Professional wrestling | profiles|cagematch = 691|wrestlingdata = 336|iwd =john-cena-350}}', "Professional wrestling/testcases's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
    self:preprocess_equals('{{#invoke:Professional wrestling | profiles|name = John Cena|cagematch = 691|wrestlingdata = 336|iwd =john-cena-350}}', "John Cena's profile at [http://www.cagematch.net/?id=2&nr=691 Cagematch.net], [http://wrestlingdata.com/index.php?befehl=bios&wrestler=336 Wrestlingdata.com], [http://www.profightdb.com/wrestlers/john-cena-350.html Internet Wrestling Database]");
end

function p:test_wrestling_titles()
	self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities|id = zbyszko_stanislaus|name = Stanislaus Zbyszko}}', "[http://www.wrestling-titles.com/personalities/zbyszko_stanislaus/ Stanislaus Zbyszko]'s profile at Wrestling-Titles.com");
	self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities|id = zbyszko_stanislaus}}', "[http://www.wrestling-titles.com/personalities/zbyszko_stanislaus/ Professional wrestling/testcases]'s profile at Wrestling-Titles.com");
    self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities|zbyszko_stanislaus| Stanislaus Zbyszko}}', "[http://www.wrestling-titles.com/personalities/zbyszko_stanislaus/ Stanislaus Zbyszko]'s profile at Wrestling-Titles.com");
	self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities|zbyszko_stanislaus}}', "[http://www.wrestling-titles.com/personalities/zbyszko_stanislaus/ Professional wrestling/testcases]'s profile at Wrestling-Titles.com");
    self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities|}}', "Category:Wrestling Titles template with no id set");
    self:preprocess_equals('{{#invoke:Professional wrestling | wrestlingtitlespersonalities| name = test}}', "Category:Wrestling Titles template with no id set");
end 



return p