
using LittleTown.StaticDataAcces;

namespace LittleTown.Core.Tests;

public class BuildingTesting
{
    ICollection<Building> _buildings;

    public BuildingTesting()
    {
        StaticDataGetter getter = new StaticDataGetter();
        _buildings = getter.GetBuildings();
    }

    [Fact]
    public void TestCosts()
    {
        Building? b = _buildings.FirstOrDefault(b => b.Name.Equals("Atelier"));
        Assert.NotNull(b);
        Assert.Equal(2, b.Price[Enums.ResourceType.Rock]);

        b = _buildings.FirstOrDefault(b => b.Name == "Bar");
        Assert.NotNull(b);
        Assert.Equal(2, b.Price[Enums.ResourceType.Cereal]);
        Assert.Equal(2, b.Price[Enums.ResourceType.Rock]);

        Assert.Equal(12, _buildings.Count(b => b.BeginnerBuilding));
    }
}