import 'dart:math';

import 'package:flutter_test/flutter_test.dart';
import 'package:game_test/game/enums.dart';
import 'package:game_test/game/logic/effect_event_factory.dart';
import 'package:game_test/game/models.dart';

void main() {
  test('enemy attack can target a named player character', () {
    final enemy = Character(name: 'Scrawny Piso', maxHp: 20, armor: 0, atk: 6);
    final player = Character(name: 'Warrior', maxHp: 50, armor: 0, atk: 5);

    final event = EffectEventFactory.createAttackEvent(
      attacker: enemy,
      target: player,
      effectTarget: EffectTarget.player,
      risk: RiskLevel.safe,
      damage: 6,
      random: Random(0),
    );

    expect(event.target, EffectTarget.player);
    expect(event.attacker, enemy);
    expect(event.targetEntity, player);
  });
}
