37 lines
849 B
C#
37 lines
849 B
C#
|
|
using Theriapolis.Core.Rules.Stats;
|
||
|
|
using Xunit;
|
||
|
|
|
||
|
|
namespace Theriapolis.Tests.Rules;
|
||
|
|
|
||
|
|
public sealed class ProficiencyBonusTests
|
||
|
|
{
|
||
|
|
[Theory]
|
||
|
|
[InlineData(1, 2)]
|
||
|
|
[InlineData(2, 2)]
|
||
|
|
[InlineData(3, 2)]
|
||
|
|
[InlineData(4, 2)]
|
||
|
|
[InlineData(5, 3)]
|
||
|
|
[InlineData(6, 3)]
|
||
|
|
[InlineData(8, 3)]
|
||
|
|
[InlineData(9, 4)]
|
||
|
|
[InlineData(12, 4)]
|
||
|
|
[InlineData(13, 5)]
|
||
|
|
[InlineData(16, 5)]
|
||
|
|
[InlineData(17, 6)]
|
||
|
|
[InlineData(20, 6)]
|
||
|
|
public void ForLevel_MatchesD20Table(int level, int expected)
|
||
|
|
{
|
||
|
|
Assert.Equal(expected, ProficiencyBonus.ForLevel(level));
|
||
|
|
}
|
||
|
|
|
||
|
|
[Theory]
|
||
|
|
[InlineData(0)]
|
||
|
|
[InlineData(-1)]
|
||
|
|
[InlineData(21)]
|
||
|
|
[InlineData(100)]
|
||
|
|
public void ForLevel_OutOfRange_Throws(int level)
|
||
|
|
{
|
||
|
|
Assert.Throws<ArgumentOutOfRangeException>(() => ProficiencyBonus.ForLevel(level));
|
||
|
|
}
|
||
|
|
}
|