<?php

declare(strict_types=1);

namespace App\Tests\Unit\Scolarite\Domain\Model\Competency;

use App\Scolarite\Domain\Model\Competency\CompetencyEvaluation;
use App\Scolarite\Domain\Model\Competency\CompetencyEvaluationId;
use App\Scolarite\Domain\Model\Competency\CompetencyId;
use App\Scolarite\Domain\Model\Evaluation\EvaluationId;
use PHPUnit\Framework\Attributes\Test;
use PHPUnit\Framework\TestCase;

final class CompetencyEvaluationTest extends TestCase
{
    #[Test]
    public function creerSetsAllProperties(): void
    {
        $evaluationId = EvaluationId::generate();
        $competencyId = CompetencyId::generate();

        $ce = CompetencyEvaluation::creer(
            evaluationId: $evaluationId,
            competencyId: $competencyId,
        );

        self::assertTrue($ce->evaluationId->equals($evaluationId));
        self::assertTrue($ce->competencyId->equals($competencyId));
    }

    #[Test]
    public function reconstituteRestoresAllProperties(): void
    {
        $id = CompetencyEvaluationId::generate();
        $evaluationId = EvaluationId::generate();
        $competencyId = CompetencyId::generate();

        $ce = CompetencyEvaluation::reconstitute(
            id: $id,
            evaluationId: $evaluationId,
            competencyId: $competencyId,
        );

        self::assertTrue($ce->id->equals($id));
        self::assertTrue($ce->evaluationId->equals($evaluationId));
        self::assertTrue($ce->competencyId->equals($competencyId));
    }
}
