. */ declare(strict_types=1); namespace Fisharebest\Webtrees\Census; use Fisharebest\Webtrees\TestCase; /** * Test harness for the class CensusOfScotland1841 */ class CensusOfScotland1841Test extends TestCase { /** * Test the census place and date * * @covers \Fisharebest\Webtrees\Census\CensusOfScotland1841 * * @return void */ public function testPlaceAndDate(): void { $census = new CensusOfScotland1841(); $this->assertSame('Scotland', $census->censusPlace()); $this->assertSame('06 JUN 1841', $census->censusDate()); } /** * Test the census columns * * @covers \Fisharebest\Webtrees\Census\CensusOfScotland1841 * @covers \Fisharebest\Webtrees\Census\AbstractCensusColumn * * @return void */ public function testColumns(): void { $census = new CensusOfScotland1841(); $columns = $census->columns(); $this->assertCount(6, $columns); $this->assertInstanceOf(CensusColumnFullName::class, $columns[0]); $this->assertInstanceOf(CensusColumnAgeMale5Years::class, $columns[1]); $this->assertInstanceOf(CensusColumnAgeFemale5Years::class, $columns[2]); $this->assertInstanceOf(CensusColumnOccupation::class, $columns[3]); $this->assertInstanceOf(CensusColumnNull::class, $columns[4]); $this->assertInstanceOf(CensusColumnBornForeignParts::class, $columns[5]); $this->assertSame('Name', $columns[0]->abbreviation()); $this->assertSame('AgeM', $columns[1]->abbreviation()); $this->assertSame('AgeF', $columns[2]->abbreviation()); $this->assertSame('Occupation', $columns[3]->abbreviation()); $this->assertSame('BiC', $columns[4]->abbreviation()); $this->assertSame('EIF', $columns[5]->abbreviation()); $this->assertSame('Name', $columns[0]->title()); $this->assertSame('Age (males)', $columns[1]->title()); $this->assertSame('Age (females)', $columns[2]->title()); $this->assertSame('Profession, trade, employment or of independent means', $columns[3]->title()); $this->assertSame('Born in same county', $columns[4]->title()); $this->assertSame('Born in England, Ireland or foreign parts', $columns[5]->title()); } }