using Library;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms.Design;
namespace UnitTests
{
    [TestClass]
    public class SuitsTests
    {
        private readonly ISuitService _suitService;

        public SuitsTests()
        {
            var url = "https://eykhnnlgofgxdzlixydt.supabase.co";
            var key = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImV5a2hubmxnb2ZneGR6bGl4eWR0Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjkyMzQ4NzgsImV4cCI6MjA0NDgxMDg3OH0.gG_nBmJ1KjC3se3HHNoBJLN8UA-aTw7JJw9PIMwJoL0";

            // Создаем экземпляр SupabaseClientFactory и GenderService
            var factory = new SupabaseClientFactory(url, key);
            var client = factory.CreateClient();
            _suitService = new SuitService(client);
        }

        [TestMethod]
        public async Task GetAllSuitsAsync_ReturnsGenders_WhenDataExists()
        {
            var suits = await _suitService.GetAllSuitsAsync();

            Assert.IsNotNull(suits);
            Assert.AreEqual(4, suits.Count);
            Assert.AreEqual(suits[0].Title, "Жезлы");
            Assert.AreEqual(suits[1].Title, "Мечи");
            Assert.AreEqual(suits[2].Title, "Кубки");
            Assert.AreEqual(suits[3].Title, "Пентакли");
        }
    }
}
