<?php

namespace Tests\Unit\Services\Administrator;

use App\Services\Administrator\AdministratorTeacherSubmissionService;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Mockery;
use Tests\TestCase;

class AdministratorTeacherSubmissionServiceTest extends TestCase
{
    use RefreshDatabase;

    public function test_delegates_to_report_and_notification(): void
    {
        $report = Mockery::mock(\App\Services\Administrator\TeacherSubmissionReportService::class);
        $report->shouldReceive('report')->once()->andReturn(['rows' => []]);

        $notify = Mockery::mock(\App\Services\Administrator\TeacherSubmissionNotificationService::class);
        $notify->shouldReceive('send')->once()->andReturn(['success' => true]);

        $service = new AdministratorTeacherSubmissionService($report, $notify);

        $this->assertSame(['rows' => []], $service->report());
        $this->assertSame(['success' => true], $service->sendNotifications(new \Illuminate\Http\Request(), 1));
    }
}
