using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using QwirkleClassLibrary.Games;
using QwirkleClassLibrary.Players;
using QwirkleClassLibrary.Tiles;

namespace TestBase;

public class TestLeaderboard
{
    [Fact]
    public void Test_LeaderboardAdd()
    {
        var leaderboard = new Leaderboard();
        var game = new Game();

        List<string> playerstest = ["test", "test1"];
        game.AddPlayerInGame(playerstest);

        game.StartGame();
        game.GiveTilesToPlayers();
        game.SetFirstPlayer(game.PlayerList);

        var tile = new Tile(Shape.Club, Color.Blue);
        game.PlaceTile(game.GetPlayingPlayer(), tile, 1, 1);

        leaderboard.AddScoreInLead(game.ScoreBoard);

        Assert.True(true);
    }

    [Fact]
    public void Test_LeaderboardAdd2()
    {
        var leaderboard = new Leaderboard();
        var game = new Game();

        List<string> playerstest = ["test", "test1"];
        game.AddPlayerInGame(playerstest);

        game.StartGame();
        game.GiveTilesToPlayers();
        game.SetFirstPlayer(game.PlayerList);

        var tile = new Tile(Shape.Club, Color.Blue);
        game.PlaceTile(game.GetPlayingPlayer(), tile, 1, 1);

        leaderboard.AddScoreInLead(game.ScoreBoard);

        game.AddPlayerInGame(playerstest);

        game.StartGame();
        game.SetFirstPlayer(game.PlayerList);

        game.PlaceTile(game.GetPlayingPlayer(), tile, 1, 1);

        leaderboard.AddScoreInLead(game.ScoreBoard);

        Assert.Equal(2, leaderboard.Lb[1].Victories);
    }


}
