Add test of StaminaComponent crit vs animation thresholds (#39249)
Add test of StaminaComponent crit vs animation thresholds
This commit is contained in:
@@ -0,0 +1,29 @@
|
|||||||
|
using Content.Shared.Damage.Components;
|
||||||
|
|
||||||
|
namespace Content.IntegrationTests.Tests.Damageable;
|
||||||
|
|
||||||
|
public sealed class StaminaComponentTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public async Task ValidatePrototypes()
|
||||||
|
{
|
||||||
|
await using var pair = await PoolManager.GetServerClient();
|
||||||
|
var server = pair.Server;
|
||||||
|
|
||||||
|
var protos = pair.GetPrototypesWithComponent<StaminaComponent>();
|
||||||
|
|
||||||
|
await server.WaitAssertion(() =>
|
||||||
|
{
|
||||||
|
Assert.Multiple(() =>
|
||||||
|
{
|
||||||
|
foreach (var (proto, comp) in protos)
|
||||||
|
{
|
||||||
|
Assert.That(comp.AnimationThreshold, Is.LessThan(comp.CritThreshold),
|
||||||
|
$"Animation threshold on {proto.ID} must be less than its crit threshold.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
await pair.CleanReturnAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user