<?php

declare(strict_types=1);

namespace Seka\Portal\Modul\Statistiky\Tests\Unit\Entities\Zaznam\Enums;

use Seka\Portal\Modul\Statistiky\Tests\TestCase;
use Seka\Portal\Modul\Statistiky\Entities\Zaznam\Enums\DruhPalivaEnum;

/**
 * Class DruhPalivaEnumTest
 *
 * @package Seka\Portal\Modul\Statistiky\Tests\Unit\Entities\Zaznam\Enums
 */
class DruhPalivaEnumTest extends TestCase
{
    /**
     *
     */
    public function testB()
    {
        $this->testing('B');
    }

    /**
     *
     */
    public function testD()
    {
        $this->testing('D');
    }

    /**
     *
     */
    public function testE()
    {
        $this->testing('E');
    }

    /**
     *
     */
    public function testNG()
    {
        $this->testing('NG');
    }

    /**
     *
     */
    public function testLPG()
    {
        $this->testing('LPG');
    }

    /**
     *
     */
    public function testB_NG()
    {
        $this->testing('B_NG');
    }

    /**
     *
     */
    public function testB_LPG()
    {
        $this->testing('B_LPG');
    }

    /**
     *
     */
    public function testPocetDruhovZaznamu()
    {
        self::assertCount(7, DruhPalivaEnum::toValues());
    }

    /**
     * @param string $value
     */
    private function testing(string $value)
    {
        self::assertStringEndsWith($value, DruhPalivaEnum::$value()->value);
        self::assertStringStartsWith($value, DruhPalivaEnum::$value()->value);
        self::assertTrue(DruhPalivaEnum::$value()->equals(DruhPalivaEnum::make($value)));
    }
}
