<?php

namespace Tests\Unit\Services\Assignment;

use App\Models\ClassSection;
use App\Services\Assignment\AssignmentSectionService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\DB;
use Tests\TestCase;

class AssignmentSectionServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_get_section_names_map(): void
    {
        DB::table('classSection')->insert([
            'id' => 1,
            'class_id' => 1,
            'class_section_id' => 101,
            'class_section_name' => '1-A',
            'semester' => 'Fall',
            'school_year' => '2025-2026',
        ]);

        $service = new AssignmentSectionService(new ClassSection());
        $map = $service->getSectionNamesMap([1]);

        $this->assertSame('1-A', $map[1]);
    }
}
