<?php

namespace Blackbirdchess\Tests\Service\Import\Readers;

use Blackbirdchess\Service\Import\Readers\Pairtwo6;
use PHPUnit\Framework\TestCase;

class Pairtwo6Test extends TestCase
{
    private string $testfile = '/res/Pairtwo6-testfile.sws';
    private Pairtwo6 $testobject;

    public function setUp(): void
    {
        $this->testfile = getcwd() . $this->testfile;
        $this->testobject = new Pairtwo6();
        $this->testobject->read($this->testfile);
    }

    public function testReadTournamentName(): void
    {
        $this->assertEquals('Blackbird Chess Unit Test Tournament', $this->testobject->Tournament->Name);
    }

    public function testReadTournamentOrganiser(): void
    {
        $this->assertEquals('Blackbird Chess Developers', $this->testobject->Tournament->Organiser);
    }

    public function testReadTournamentLocation(): void
    {
        $this->assertEquals('Waregem', $this->testobject->Tournament->OrganiserPlace);
    }

    public function testHas8Players(): void
    {
        $this->assertCount(8, $this->testobject->Tournament->Players);
    }

    public function testHas7Rounds(): void
    {
        $this->assertCount(7, $this->testobject->Tournament->Rounds);
    }
}