PkmnLib.NET/PkmnLib.Tests/Dataloader/SpeciesDataloaderTests.cs

35 lines
1.2 KiB
C#
Raw Normal View History

2024-08-18 12:22:50 +00:00
using PkmnLib.Dataloader;
using PkmnLib.Static.Libraries;
namespace PkmnLib.Tests.Dataloader;
public class SpeciesDataloaderTests
{
[Test]
2024-12-27 13:30:22 +00:00
public async Task TestPrimarySpeciesFile()
2024-08-18 12:22:50 +00:00
{
2024-12-27 13:30:22 +00:00
using var file = File.Open("Data/Pokemon.json", FileMode.Open, FileAccess.Read, FileShare.Read);
2024-08-18 12:22:50 +00:00
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");
2025-03-02 16:19:57 +00:00
2024-08-18 12:22:50 +00:00
var library = SpeciesDataLoader.LoadSpecies(file, typeLibrary);
2024-12-27 13:30:22 +00:00
await Assert.That(library).IsNotNull();
2024-08-18 12:22:50 +00:00
}
}