<?php

declare(strict_types=1);

namespace App\Tests\Unit\Administration\Domain\Model\Import;

use App\Administration\Domain\Model\Import\ImportStatus;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

final class ImportStatusTest extends TestCase
{
    #[Test]
    public function peutDemarrerOnlyForPending(): void
    {
        self::assertTrue(ImportStatus::PENDING->peutDemarrer());
        self::assertFalse(ImportStatus::PROCESSING->peutDemarrer());
        self::assertFalse(ImportStatus::COMPLETED->peutDemarrer());
        self::assertFalse(ImportStatus::FAILED->peutDemarrer());
    }

    #[Test]
    public function estTermineForCompletedAndFailed(): void
    {
        self::assertFalse(ImportStatus::PENDING->estTermine());
        self::assertFalse(ImportStatus::PROCESSING->estTermine());
        self::assertTrue(ImportStatus::COMPLETED->estTermine());
        self::assertTrue(ImportStatus::FAILED->estTermine());
    }

    #[Test]
    public function labelReturnsReadableText(): void
    {
        self::assertSame('En attente', ImportStatus::PENDING->label());
        self::assertSame('En cours', ImportStatus::PROCESSING->label());
        self::assertSame('Terminé', ImportStatus::COMPLETED->label());
        self::assertSame('Échoué', ImportStatus::FAILED->label());
    }
}
