40 lines
1.2 KiB
C#

using System.Collections.Generic;
using NUnit.Framework;
using pflib_net.characters.internals.stats;
namespace pflib_net.Tests.characters.internals.stats;
[TestFixture]
[TestOf(typeof(Stats))]
public class StatsTest
{
private readonly Dictionary<StatType, int> _values = new Dictionary<StatType, int>()
{
{ StatType.Strength, 1 },
{ StatType.Dexterity, 2 },
{ StatType.Constitution, 3 },
{ StatType.Intelligence, 4 },
{ StatType.Wisdom, 5 },
{ StatType.Charisma, 6 }
};
[Test]
[TestCase(StatType.Strength)]
[TestCase(StatType.Dexterity)]
[TestCase(StatType.Constitution)]
[TestCase(StatType.Intelligence)]
[TestCase(StatType.Wisdom)]
[TestCase(StatType.Charisma)]
public void GetStatsGivesCorrectValues(StatType type)
{
var stats = new Stats(
_values[StatType.Strength],
_values[StatType.Dexterity],
_values[StatType.Constitution],
_values[StatType.Intelligence],
_values[StatType.Wisdom],
_values[StatType.Charisma]
);
Assert.That(stats.GetStat(type), Is.EqualTo(_values[type]));
}
}