Jump to content

Module:Infobox gridiron football person/convert/testcases

From Wikipedia, the free encyclopedia
local p = require('Module:UnitTests')

function p:test_blank()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main}}', '{{Infobox gridiron football person}}')
end

function p:test_teamsYears()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<br>2<br>3|playing_teams=A<br>B<br>C}}', '{{Infobox gridiron football person|playing_years=1<br>2<br>3|playing_teams=A<br>B<br>C}}')
end

function p:test_teamsYears_brSpaces()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<br >2<br      >3|playing_teams=A<br >B<br      >C}}', '{{Infobox gridiron football person|playing_years=1<br >2<br      >3|playing_teams=A<br >B<br      >C}}')
end

function p:test_teamsYears_allTheBrs()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<BR>2<br/>3<BR/>4|playing_teams=A<br />B<br>C<BR />D}}', '{{Infobox gridiron football person|playing_years=1<BR>2<br/>3<BR/>4|playing_teams=A<br />B<br>C<BR />D}}')
end

function p:test_teamsYears_withSports()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=Basketball<br>1<br>2<br>3|playing_teams=<br>A<br>B<br>C}}', '{{Infobox gridiron football person|playing_years=Basketball<br>1<br>2<br>3|playing_teams=<br>A<br>B<br>C}}')
end

function p:test_teamsYears_withSports_multipleBrs()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=Basketball<br><br>1<br>2<br>3|playing_teams=<br><br>A<br>B<br>C}}', '{{Infobox gridiron football person|playing_years=Basketball<br><br>1<br>2<br>3|playing_teams=<br><br>A<br>B<br>C}}')
end

function p:test_teamsYears_unbalancedYears()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<br><br>2<br>3|playing_teams=A<br>B<br>C}}', '{{Infobox gridiron football person|playing_years=1<br><br>2<br>3|playing_teams=A<br>B<br>C}}')
end

function p:test_teamsYears_unbalancedTeams()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<br>2<br>3|playing_teams=A<br>B<br><br>C}}', '{{Infobox gridiron football person|playing_years=1<br>2<br>3|playing_teams=A<br>B<br><br>C}}')
end

function p:test_teamsYears_teamsBlank()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=1<br>2<br>3|playing_teams=}}', '{{Infobox gridiron football person|playing_years=1<br>2<br>3|playing_teams=}}')
end

function p:test_teamsYears_yearsBlank()
    self:preprocess_equals('{{#invoke:Infobox gridiron football person/convert|main|playing_years=|playing_teams=A<br>B<br>C}}', '{{Infobox gridiron football person|playing_years=|playing_teams=A<br>B<br>C}}')
end

function p:test_genericDemo()
    self:preprocess_equals([=[{{#invoke:Infobox gridiron football person/convert|main|name=Corey Chamblin
 |full_name=
 |team=Saskatchewan Roughriders
 |image=
 |ImageWidth=
 |caption=
 |status=
 |position1=Head coach
 |Height_ft=
 |Height_in=
 |Weight_lbs=
 |birth_date={{birth date and age|1977|5|29}}
 |birth_place=[[Birmingham, Alabama]]
 |college=[[Tennessee Technological University|Tennessee Tech]]
 |high_school=
 |coaching_years={{FRA season|2006}}<br>{{CFL Year|2007}}<br>{{CFL Year|2008}}–{{CFL Year|2010}}<br>{{CFL Year|2011}}<br>{{CFL Year|2012}}–present
 |coaching_teams=[[Frankfurt Galaxy]] (Ass. [[Defensive backs coach|DBC]])<br>[[Winnipeg Blue Bombers]] (DBC)<br>[[Calgary Stampeders]] (DBC)<br>[[Hamilton Tiger-Cats]] ([[Defensive coordinator|DC]]/DBC)<br>[[Saskatchewan Roughriders]] ([[Head Coach|HC]])
 |playing_years={{NFL Year|1999}}*<br>{{NFL Year|1999}}–{{NFL Year|2000}}<br>{{NFL Year|2001}}*<br>{{NFL Year|2002}}*<br>{{NFL Year|2003}}*<br>{{RHE season|2004}}<br>{{NFL Year|2004}}*
 |playing_teams=[[Baltimore Ravens]]<br>[[Jacksonville Jaguars]]<br>[[Green Bay Packers]]<br>[[Tampa Bay Buccaneers]]<br>[[Denver Broncos]]<br>[[Rhein Fire]]<br>[[Indianapolis Colts]]
|career_footnotes=<nowiki/>*Offseason and/or practice squad member only
 |career_highlights=
* [[World Bowl]] champion ([[World Bowl XIV|XIV]])
* [[Grey Cup]] champion ([[96th Grey Cup|96th]])
* [[Grey Cup]] champion ([[101st Grey Cup|101st]])
* {{CFL Year|2013}} CFL [[Annis Stukus Trophy|Coach of the Year]]

 |Awards= 
 |Honors= 
 |Records= 
 |NFL=CHA154467
}}]=], [=[{{Infobox gridiron football person
 |name=Corey Chamblin
 |full_name=
 |team=Saskatchewan Roughriders
 |image=
 |ImageWidth=
 |caption=
 |status=
 |position1=Head coach
 |Height_ft=
 |Height_in=
 |Weight_lbs=
 |birth_date={{birth date and age|1977|5|29}}
 |birth_place=[[Birmingham, Alabama]]
 |college=[[Tennessee Technological University|Tennessee Tech]]
 |high_school=
 |coaching_years={{FRA season|2006}}<br>{{CFL Year|2007}}<br>{{CFL Year|2008}}–{{CFL Year|2010}}<br>{{CFL Year|2011}}<br>{{CFL Year|2012}}–present
 |coaching_teams=[[Frankfurt Galaxy]] (Ass. [[Defensive backs coach|DBC]])<br>[[Winnipeg Blue Bombers]] (DBC)<br>[[Calgary Stampeders]] (DBC)<br>[[Hamilton Tiger-Cats]] ([[Defensive coordinator|DC]]/DBC)<br>[[Saskatchewan Roughriders]] ([[Head Coach|HC]])
 |playing_years={{NFL Year|1999}}*<br>{{NFL Year|1999}}–{{NFL Year|2000}}<br>{{NFL Year|2001}}*<br>{{NFL Year|2002}}*<br>{{NFL Year|2003}}*<br>{{RHE season|2004}}<br>{{NFL Year|2004}}*
 |playing_teams=[[Baltimore Ravens]]<br>[[Jacksonville Jaguars]]<br>[[Green Bay Packers]]<br>[[Tampa Bay Buccaneers]]<br>[[Denver Broncos]]<br>[[Rhein Fire]]<br>[[Indianapolis Colts]]
|career_footnotes=<nowiki/>*Offseason and/or practice squad member only
 |career_highlights=
* [[World Bowl]] champion ([[World Bowl XIV|XIV]])
* [[Grey Cup]] champion ([[96th Grey Cup|96th]])
* [[Grey Cup]] champion ([[101st Grey Cup|101st]])
* {{CFL Year|2013}} CFL [[Annis Stukus Trophy|Coach of the Year]]

 |Awards= 
 |Honors= 
 |Records= 
 |NFL=CHA154467
}}]=])
end

return p