<?php

namespace App\Tests\Entity;

use App\Entity\ServiceCategory;
use PHPUnit\Framework\TestCase;

class ServiceCategoryTest extends TestCase
{
    public function testConstructor(): void
    {
        $cat = new ServiceCategory('Infrastructure', 'infra');
        $this->assertNull($cat->getId());
        $this->assertSame('Infrastructure', $cat->getName());
        $this->assertSame('infra', $cat->getSlug());
        $this->assertSame(0, $cat->getPosition());
        $this->assertInstanceOf(\DateTimeImmutable::class, $cat->getCreatedAt());
        $this->assertCount(0, $cat->getServices());
    }

    public function testSetName(): void
    {
        $cat = new ServiceCategory('Web', 'web');
        $cat->setName('Email');
        $this->assertSame('Email', $cat->getName());
    }

    public function testSetPosition(): void
    {
        $cat = new ServiceCategory('Web', 'web');
        $cat->setPosition(3);
        $this->assertSame(3, $cat->getPosition());
    }
}
