import type { Logger } from '@core/shared/domain/Logger';
import { describe, expect, it, vi } from 'vitest';
import { InMemoryDriverRatingProvider } from './InMemoryDriverRatingProvider';

describe('InMemoryDriverRatingProvider', () => {
  it('returns ratings for known drivers and null for unknown', () => {
    const logger = {
      debug: vi.fn(),
      info: vi.fn(),
      warn: vi.fn(),
      error: vi.fn(),
    } as unknown as Logger;

    const provider = new InMemoryDriverRatingProvider(logger);

    expect(provider.getRating('driver-1')).toBe(2500);
    expect(provider.getRating('driver-2')).toBe(2400);
    expect(provider.getRating('driver-x')).toBeNull();

    const map = provider.getRatings(['driver-1', 'driver-x', 'driver-2']);
    expect(map.get('driver-1')).toBe(2500);
    expect(map.get('driver-2')).toBe(2400);
    expect(map.has('driver-x')).toBe(false);
  });
});
