Malachy Byrne be32882cd0
All checks were successful
MANDATORY: Build project (Pflib Net) TeamCity build finished
PF-1: Add basic classes (#1)
Add basic classes for characters with rudimentary testing

Reviewed-on: #1
2024-06-15 02:05:33 +02:00

38 lines
1.3 KiB
C#

using System.Collections.Generic;
using NUnit.Framework;
using pflib_net.characters.internals.proficiencies;
namespace pflib_net.Tests.characters.internals.proficiencies;
[TestFixture]
[TestOf(typeof(ArmorProficiency))]
public class ArmorProficiencyTest
{
private Dictionary<ProficiencyType, int> _values = new()
{
{ ProficiencyType.Unarmored, 0},
{ ProficiencyType.LightArmor, 5 },
{ ProficiencyType.MediumArmor, 7 },
{ ProficiencyType.HeavyArmor, 9 }
};
private Dictionary<ProficiencyType, ProficiencyValue> _proficiencyValues =
new()
{
{ ProficiencyType.Unarmored, ProficiencyValue.None },
{ ProficiencyType.LightArmor, ProficiencyValue.Trained },
{ ProficiencyType.MediumArmor, ProficiencyValue.Expert },
{ ProficiencyType.HeavyArmor, ProficiencyValue.Master }
};
[Test]
[TestCase(ProficiencyType.Unarmored)]
[TestCase(ProficiencyType.LightArmor)]
[TestCase(ProficiencyType.MediumArmor)]
[TestCase(ProficiencyType.HeavyArmor)]
public void GetValueReturnsCorrectAc(ProficiencyType type)
{
var armorProficiency = new ArmorProficiency(_proficiencyValues);
Assert.That(armorProficiency.GetValue(type, 3), Is.EqualTo(_values[type]));
}
}