using PkmnLib.Dataloader;
using PkmnLib.Static.Libraries;

namespace PkmnLib.Tests.Dataloader;

public class SpeciesDataloaderTests
{
    [Test]
    public async Task TestPrimarySpeciesFile()
    {
        using var file = File.Open("Data/Pokemon.json", FileMode.Open, FileAccess.Read, FileShare.Read);
        var typeLibrary = new TypeLibrary();
        typeLibrary.RegisterType("Normal");
        typeLibrary.RegisterType("Fire");
        typeLibrary.RegisterType("Water");
        typeLibrary.RegisterType("Electric");
        typeLibrary.RegisterType("Grass");
        typeLibrary.RegisterType("Ice");
        typeLibrary.RegisterType("Fighting");
        typeLibrary.RegisterType("Poison");
        typeLibrary.RegisterType("Ground");
        typeLibrary.RegisterType("Flying");
        typeLibrary.RegisterType("Psychic");
        typeLibrary.RegisterType("Bug");
        typeLibrary.RegisterType("Rock");
        typeLibrary.RegisterType("Ghost");
        typeLibrary.RegisterType("Dragon");
        typeLibrary.RegisterType("Dark");
        typeLibrary.RegisterType("Steel");
        typeLibrary.RegisterType("Fairy");
        
        var library = SpeciesDataLoader.LoadSpecies(file, typeLibrary);
        await Assert.That(library).IsNotNull();
    }
}