<?php

declare(strict_types=1);

/*
 * This file is part of the Ferienpass package.
 *
 * (c) Richard Henkenjohann <richard@ferienpass.online>
 *
 * For more information visit the project website <https://ferienpass.online>
 * or the documentation under <https://docs.ferienpass.online>.
 */

namespace Ferienpass\CoreBundle\Tests\Notification;

use Ferienpass\CoreBundle\Notification\AttendanceNotificationChecker;
use PHPUnit\Framework\TestCase;

final class AttendanceNotificationCheckerTest extends TestCase
{
    private AttendanceNotificationChecker $checker;

    protected function setUp(): void
    {
        $this->checker = new AttendanceNotificationChecker();
    }

    public function testNewConfirmedShouldNotify(): void
    {
        self::assertTrue($this->checker->shouldNotify('confirmed', true));
    }

    public function testNewWaitingShouldNotNotify(): void
    {
        self::assertFalse($this->checker->shouldNotify('waiting', true));
    }

    public function testNewRejectedShouldNotNotify(): void
    {
        self::assertFalse($this->checker->shouldNotify('rejected', true));
    }

    public function testExistingConfirmedShouldNotify(): void
    {
        self::assertTrue($this->checker->shouldNotify('confirmed', false));
    }

    public function testExistingRejectedShouldNotify(): void
    {
        self::assertTrue($this->checker->shouldNotify('rejected', false));
    }

    public function testExistingWithdrawnShouldNotify(): void
    {
        self::assertTrue($this->checker->shouldNotify('withdrawn', false));
    }

    public function testExistingWaitingShouldNotNotify(): void
    {
        self::assertFalse($this->checker->shouldNotify('waiting', false));
    }
}
