<?php

namespace Tests\Unit\Services\ClassPreparation;

use App\Services\ClassPreparation\ClassPreparationContextService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;

class ClassPreparationContextServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_has_roster_for_semester(): void
    {
        DB::table('student_class')->insert([
            'student_id' => 1,
            'class_section_id' => 101,
            'semester' => 'Fall',
            'school_year' => '2025-2026',
        ]);

        $service = new ClassPreparationContextService();

        $this->assertTrue($service->hasRosterForSemester('2025-2026', 'Fall'));
        $this->assertFalse($service->hasRosterForSemester('2025-2026', 'Spring'));
    }
}
