<?php
declare(strict_types=1);

namespace Tests\FreshCloud\Mail\NetSocket;

use FreshCloud\Mail\NetSocket\SocketConfig;
use PHPUnit\Framework\TestCase;
use InvalidArgumentException;

final class SocketConfigTest extends TestCase
{
    public function testValidPort(): void
    {
        $config = new SocketConfig('example.com', 8080);
        $this->assertSame(8080, $config->port);
    }

    public function testInvalidPort(): void
    {
        $this->expectException(InvalidArgumentException::class);
        new SocketConfig('example.com', 70000);
    }

    public function testDefaultValues(): void
    {
        $config = new SocketConfig('example.com', 80);
        $this->assertSame(30, $config->timeoutSeconds);
        $this->assertFalse($config->sslEnabled);
    }
}