<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Tests\Unit\Services\Analyzators;

use Seka\Portal\Modul\Statistiky\Tests\TestCase;
use Seka\Portal\Modul\Statistiky\Services\Import\File;
use Seka\Portal\Modul\Statistiky\Services\Analyzators\XLSXHeader;
use Seka\Portal\Modul\Statistiky\Services\Analyzators\XLSXDataAnalyzator;
use Seka\Portal\Modul\Statistiky\Services\Analyzators\DataAnalyzatorContract;

/**
 * Class XLSXDataAnalyzatorTest
 *
 * @package Seka\Portal\Modul\Statistiky\Tests\Unit\Services\Analyzators
 */
class XLSXDataAnalyzatorTest extends TestCase
{
    /**
     * @var \Seka\Portal\Modul\Statistiky\Services\Analyzators\XLSXDataAnalyzator
     */
    private XLSXDataAnalyzator $analyzer;

    /**
     * @var \Seka\Portal\Modul\Statistiky\Services\Import\File
     */
    private File $file;

    /**
     *
     */
    public function setUp(): void
    {
        parent::setUp();

        $this->analyzer = new XLSXDataAnalyzator(XLSXHeader::$header);
        $this->file = new File(__DIR__ . '/../DENNY_VYPIS_KONTROL.xlsx');
    }

    /**
     *
     */
    public function testInstance()
    {
        self::assertInstanceOf(XLSXDataAnalyzator::class, $this->analyzer);
    }

    /**
     *
     */
    public function testAnalyze()
    {
        $result = $this->analyzer->analyze(DataAnalyzatorContract::LEXICAL, $this->file);

        self::assertTrue($result);
    }

    /**
     *
     */
    public function testGetErrors()
    {
        self::assertEmpty($this->analyzer->getErrors());
    }

    /**
     *
     */
    public function testGetResults()
    {
        self::assertEmpty($this->analyzer->getResults());
    }
}
