package eu.jonahbauer.wizard.core.machine;

import eu.jonahbauer.wizard.core.model.Configurations;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.RepetitionInfo;

import java.util.List;
import java.util.UUID;
import java.util.concurrent.ExecutionException;

public class GameTest {
    @RepeatedTest(3)
    public void runDefault(RepetitionInfo repetitionInfo) throws InterruptedException, ExecutionException {
        Game game = new Game(
                repetitionInfo.getCurrentRepetition(),
                Configurations.DEFAULT.withTimeout(0),
                (player, msg) -> System.out.println(msg)
        );
        var players = List.of(
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID()
        );

        game.start(players);
        game.await();
    }

    @RepeatedTest(3)
    public void runAnniversary2016(RepetitionInfo repetitionInfo) throws InterruptedException, ExecutionException {
        Game game = new Game(
                repetitionInfo.getCurrentRepetition(),
                Configurations.ANNIVERSARY_2016.withTimeout(0),
                (player, msg) -> System.out.println(msg)
        );
        var players = List.of(
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID()
        );

        game.start(players);
        game.await();
    }

    @RepeatedTest(3)
    public void runAnniversary2021(RepetitionInfo repetitionInfo) throws InterruptedException, ExecutionException {
        Game game = new Game(
                repetitionInfo.getCurrentRepetition(),
                Configurations.ANNIVERSARY_2021.withTimeout(0),
                (player, msg) -> System.out.println(msg)
        );
        var players = List.of(
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID(),
                UUID.randomUUID()
        );

        game.start(players);
        game.await();
    }
}
